Hi,
Best way is to run 'crontab -e' as the user you want to set the crontab up for. You'll need to add that user to the 'cron' group in /etc/groups before it allow you to do it, unless you do it as root.
Then, the line you want is probably:
10 */3 * * * wget -q -O /usr/share/xplanet/images/clouds_2000.jpg http://www.wizabit.eclipse.co.uk/xplanet/files/local/clouds_2000.jpg
First field is 10 minutes past each our, next one is a trick for every 3 hours, you can do this with all other fields. For example, instead of doing 0,10,20,30,40,50 you can just do */10 in the minutes field. The next 3 are day of month, month, and day of week, but you already knew that.
as for wget: almost right. Your command will have downloaded the image in the current working directory, probably /root if you put it in /etc/crontab. You need the -O to tell wget to put it elsewhere. To pipe to stdout, use '-', but since you're just putting it in a file you can put the file's path right in there.
HTH, Chris
Tony Boom wrote:
Hello gentoo-user,
Can someone please tell me how to set up a cron job? I've been reading about it all day but can't get it to work.
I want to download a jpg at 10 past the hour every three hours. I tried this in /etc/crontab but it won't work.
10 15 * * * wget -q http://www.wizabit.eclipse.co.uk/xplanet/files/local/clouds_2000.jpg > /usr/share/xplanet/images/clouds_2000.jpg
I know it's just for 15:10 but it still don't work.
smime.p7s
Description: S/MIME Cryptographic Signature
