LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Crontab not working for user (https://www.linuxquestions.org/questions/slackware-14/crontab-not-working-for-user-431458/)

mago 04-03-2006 04:50 PM

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
The folder containing the images are owend by the user and has proper rights, as a mater of fact if I run the command through a console I have no problem but the crontab seems to be ignored, no error mail no nothing.

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.

fotoguy 04-03-2006 05:56 PM

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.

dive 04-03-2006 05:59 PM

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

mago 04-03-2006 06:26 PM

Actually */5 is so it will change every 5 minutes.


I'll try adding the user, thanks for the suggestion.

dive 04-03-2006 06:26 PM

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?

dive 04-03-2006 09:48 PM

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.