Solved crontab desktop notification

talsamon

Daemon

Reaction score: 289
Messages: 1,835

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.
 
OP
talsamon

talsamon

Daemon

Reaction score: 289
Messages: 1,835

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.
 
OP
talsamon

talsamon

Daemon

Reaction score: 289
Messages: 1,835

Solved: The command was right, but it was something missing in the path inside the crontab.
 

junovitch@

Daemon
Developer

Reaction score: 632
Messages: 1,773

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.
 
OP
talsamon

talsamon

Daemon

Reaction score: 289
Messages: 1,835

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.
 
Top