Crontab not working for user
Hi,
I want something quite simple, is just to configure the fbsetbg to change randomly the background of my desktop so I just used this: Code:
*/5 * * * * /usr/X11/bin/fbsetbg -r path_to_the_wallpapers There is a crontab.# inside /var/spool/crontab and there is a specific one on /var/spool/crontab/crontabs/Xuser Any ideas? Running slack 10.2 by the way. |
Cron is run by root so you probably nned to specify the user you want to run the cron job as maybe try:
*/5 * * * * username /usr/X11/bin/fbsetbg -r path_to_the_wallpapers Just replace username with the user you are trying to run as, I think by default if you don't specify a user it runs as root. Also you might have a /etc/crontab.deny file, if you have this file make sure the name of the user you a trying to run as is not in this. |
No that shouldn't be necesary. Each user has his/her own cron. But I don't understand the */5 - is that for every 1/2 hour? Maybe try 0,30 if so
You could also try redircting messages to a log and seeing what errors are occuring |
Actually */5 is so it will change every 5 minutes.
I'll try adding the user, thanks for the suggestion. |
I just tried this (rather neat idea imo) and this is output of the log:
/usr/X11/bin/fbsetbg: line 169: xmessage: command not found Why xmessage is being called up I've no idea. Perhaps another background setting app would work? |
I got it to work by making a small script randbg:
#!/bin/bash export DISPLAY=:0.0 /usr/X11/bin/fbsetbg -r ~/.fluxbox/backgrounds/ then with crontab -e: 0,30 * * * * /home/dave/scripts/randbg 1>/dev/null 2>&1 Obviously edit this to your paths, time interval etc. |
All times are GMT -5. The time now is 10:37 AM. |