Results 1 to 10 of 13

Thread: Linux Mint 13. Cron task is not working

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Beans
    25

    Linux Mint 13. Cron task is not working

    Hello all,

    For some reason my cron job will not run. This is my setup:
    retano@OptiPlex-GX520 ~ $ pgrep cron
    902
    retano@OptiPlex-GX520 ~ $ crontab -l
    0 * * * * mate-terminal # JOB_ID_4
    retano@OptiPlex-GX520 ~ $ mate-terminal
    retano@OptiPlex-GX520 ~ $

    So it is just a simple command to get a new terminal window and it is not working. When I run it directly from terminal - it is opened ok.

    Please advise what can be wrong here?

  2. #2
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,033
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Linux Mint 13. Cron task is not working

    Is this just a test, or do you have some reason to start a new terminal like this?

    cron isn't related to a desktop session; it is for tasks that run in the background so long as the computer is running, whether a user is logged in or not. The cron job has nothing to tell it on which desktop to put the window.

    It may be possible to set the DISPLAY variable and get it to work - I'm not sure. I wouldn't recommend you to go down that road though, unless you have a genuine need.

  3. #3
    Join Date
    Nov 2009
    Beans
    25

    Re: Linux Mint 13. Cron task is not working

    I am trying to get my Sikuli scripts working. They were running Ok with Mint 10, but I can't get it working with Mint 13. I also tried to use Gnome schedule as a GUI for cron setup - it did not help also.

    This is headless PC with no monitor attached. I operate with it via VNC session
    Last edited by retano; August 4th, 2012 at 10:10 AM.

  4. #4
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,033
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Linux Mint 13. Cron task is not working

    I'm not on Mint, but this works for me. In vnc session, start a terminal, and
    Code:
    $ echo $DISPLAY
    :1.0
    Then create a cron job with crontab -e
    Code:
    0 * * * * DISPLAY=:1.0 /usr/bin/lxterminal

  5. #5
    Join Date
    Oct 2004
    Location
    Denmark - Scandinavia
    Beans
    17,619
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Linux Mint 13. Cron task is not working

    Moved to Other OS/Distro Talk.
    elementary OS Luna
    My Screenshot

  6. #6
    Join Date
    Nov 2009
    Beans
    25

    Re: Linux Mint 13. Cron task is not working

    Quote Originally Posted by spjackson View Post
    I'm not on Mint, but this works for me. In vnc session, start a terminal, and
    Code:
    $ echo $DISPLAY
    :1.0
    Then create a cron job with crontab -e
    Code:
    0 * * * * DISPLAY=:1.0 /usr/bin/lxterminal
    Does not work
    this is my output:
    $ echo $DISPLAY
    :0.0
    so I insert it like this 0 * * * * DISPLAY=:0.0 mate-terminal

  7. #7
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,033
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Linux Mint 13. Cron task is not working

    I have just tried it with a Mint 13 Live CD. It works for me. DISPLAY is :0 in this case.
    Code:
    0 * * * * DISPLAY=:0 mate-terminal
    I don't know why it won't work for you. Is there any clue in /var/log?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •