Results 1 to 4 of 4

Thread: crontab notifications

  1. #1
    Join Date
    Jun 2012
    Beans
    3

    crontab notifications

    I want to use a crontab to send a notification every day at 9 pm. I have the following "crob tab job" :

    00 21 * * * notify-send 'Title of the message' 'Text of the message'

    According to me, it should work, however nothing happens... Does anybody know why and how can I solve it.

    I am using ubuntu precise pangolin 32 bits.

    Thanks in advance

  2. #2
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: crontab notifications

    You probably need to tell crontab which display to use (crontab doesn't know if the X server is running or not).

    Try this instead:
    Code:
    00 21 * * * env DISPLAY=:0 && notify-send 'Title of the message' 'Text of the message'
    Cheesemill

  3. #3
    Join Date
    Jun 2012
    Beans
    3

    Re: crontab notifications

    Thanks, however it didn't work either. Is there a way to check if the cron process is running at the time? This way I could determine if the cron job is actually working or not (so i can focus on the real problem.

  4. #4
    Join Date
    Apr 2012
    Beans
    5,824

    Re: crontab notifications

    Is this a system crontab, or a crontab belonging to the user who currently 'owns' the display? if it's a system crontab then you may need to fix the Xauthority as well as setting the DISPLAY variable - see this similar thread: http://ubuntuforums.org/showthread.php?p=12248336

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
  •