Solved crontab desktop notification

Try make a desktop notification with crontab. The line in the crontab is:

30 * * * * user export DISPLAY=:0.0 && /usr/local/bin/myscript.

Working with notify-send in the script, my window manager is fvwm-crystal.

/var/log/cron says it is executed. but I am seeing nothing on desktop. On the commandline it works fine, and I see the notification. The script is owned and executable by user.

Any idea what I am missing or why it does not work.
 
I have changed the line to:
30 * * * * user export DISPLAY=:0.0 && export XAUTHORITY=/home/user/.Xauthority && /usr/local/bin/myscript

But does not help.
 
Also, I noticed you are using a user in your example. Are you aware of crontab -e to edit your user's crontab(1) under /var/cron/tabs? That is a far more appropriate place for your script than the system /etc/crontab.
 
It was not the full length of the path. Inside of the crontab, the second line is the path-variable, it missed /usr/local/bin. You see in my posts, I used the full path for the command.
 
Back
Top