You are not logged in.
Hi Archers,
I have to take medicines at a set time.
I configured Cron to send me visual notifications (by using Gnome's notify-send command):
florian@flobox:~$ sudo cat /var/spool/cron/florian
Password:
0 21 * * * notify-send -t 0 "Médicaments" # JOB_ID_1
0 9 * * * notify-send -t 0 "Médicaments" # JOB_ID_2
0 12 * * * notify-send -t 0 "Médicaments" # JOB_ID_3
I can't see any notification at these times.
However, crond is started (since it's in the rc.conf's deamon list):
florian@flobox:~$ ps -A | grep cron
2063 ? 00:00:00 crond
The logs signal an error:
florian@flobox:~$ sudo tail /var/log/crond.log
Password:
May 22 15:34:47 flobox crond[2063]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 15:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 2479 job sys-hourly
May 22 17:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 7436 job sys-hourly
May 22 19:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 11989 job sys-hourly
May 22 21:00:01 flobox crond[2063]: FILE /var/spool/cron/florian USER florian PID 15132 notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[2063]: exit status 1 from user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: mailing cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1
May 22 21:00:01 flobox crond[15134]: unable to exec /usr/sbin/sendmail: cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1 to /dev/null
May 22 21:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 16468 job sys-hourly
Strangely, if I restart crond manually…:
florian@flobox:~$ sudo /etc/rc.d/crond restart
Password:
:: Stopping Cron Daemon [DONE]
:: Starting Cron Daemon [DONE]
… jobs do are fired:
May 22 23:36:26 flobox crond[21150]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info
May 22 23:37:01 flobox crond[21150]: FILE /var/spool/cron/florian USER florian PID 21182 notify-send -t 0 "test" # JOB_ID_4
Here is the rc.conf's deamon list:
DAEMONS=(syslog-ng !network !netfs crond dbus hal fam @wicd gdm)
It's probably a common mistake, but I couldn't find anything on the Internet.
What did I wrong?
Offline
Any idea?
Offline
Hi Archers,
I have to take medicines at a set time.
I configured Cron to send me visual notifications (by using Gnome's notify-send command):florian@flobox:~$ sudo cat /var/spool/cron/florian Password: 0 21 * * * notify-send -t 0 "Médicaments" # JOB_ID_1 0 9 * * * notify-send -t 0 "Médicaments" # JOB_ID_2 0 12 * * * notify-send -t 0 "Médicaments" # JOB_ID_3
I can't see any notification at these times.
However, crond is started (since it's in the rc.conf's deamon list):
florian@flobox:~$ ps -A | grep cron 2063 ? 00:00:00 crond
The logs signal an error:
florian@flobox:~$ sudo tail /var/log/crond.log Password: May 22 15:34:47 flobox crond[2063]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info May 22 15:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 2479 job sys-hourly May 22 17:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 7436 job sys-hourly May 22 19:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 11989 job sys-hourly May 22 21:00:01 flobox crond[2063]: FILE /var/spool/cron/florian USER florian PID 15132 notify-send -t 0 "Médicaments" # JOB_ID_1 May 22 21:00:01 flobox crond[2063]: exit status 1 from user florian notify-send -t 0 "Médicaments" # JOB_ID_1 May 22 21:00:01 flobox crond[15134]: mailing cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1 May 22 21:00:01 flobox crond[15134]: unable to exec /usr/sbin/sendmail: cron output for user florian notify-send -t 0 "Médicaments" # JOB_ID_1 to /dev/null May 22 21:35:01 flobox crond[2063]: FILE /var/spool/cron/root USER root PID 16468 job sys-hourly
Strangely, if I restart crond manually…:
florian@flobox:~$ sudo /etc/rc.d/crond restart Password: :: Stopping Cron Daemon [DONE] :: Starting Cron Daemon [DONE]
… jobs do are fired:
May 22 23:36:26 flobox crond[21150]: /usr/sbin/crond 4.4 dillon's cron daemon, started with loglevel info May 22 23:37:01 flobox crond[21150]: FILE /var/spool/cron/florian USER florian PID 21182 notify-send -t 0 "test" # JOB_ID_4
Here is the rc.conf's deamon list:
DAEMONS=(syslog-ng !network !netfs crond dbus hal fam @wicd gdm)
It's probably a common mistake, but I couldn't find anything on the Internet.
What did I wrong?
Have you solved this issue? I've the same problem, still couldn't figure out what I did wrong. Probably a simple issue.
Here's my rc.conf daemon list;
DAEMONS=(syslog-ng !network dbus hal netfs crond @alsa @wicd)
Offline
I just found the problem. I was trying to run "xfcedesktop --reload" in crontab to change my desktop wallpaper every 5 mins. For graphical applications, you need to tell the app which display it should use (obviously, why I didn't figure that out sooner is beyond me ).
So changing from;
*/5 * * * * /usr/bin/xfdesktop --reload > /dev/null 2>&1
to;
*/1 * * * * DISPLAY=:0 /usr/bin/xfdesktop --reload > /dev/null 2>&1
did the trick for me. "DISPLAY=:0" is the default display. If you like the program to run on other display, change the number corresponding the other display. Like "DISPLAY=:1" or so on.
Offline