Getting a cron job to work :S

Associate
Joined
19 Jun 2003
Posts
1,680
Location
West Yorks, UK
Hi all,
I have written a shell script that backs up websites on our dedicated Fedora Core 3 server. I can call it through SSH with "sh /path to/script.sh" and it works great. I have added an entry at the bottom of Crontab thus:
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
0 2 * * * root /scripts/websitebackup.sh

But it doesn't run. I have restarted cron (I think!). Am I missing something from the above? I wondered if I need to put:
Code:
0 2 * * * root sh /scripts/websitebackup.sh

Any ideas?

Cheers,
Matt
 
Associate
Joined
18 Mar 2003
Posts
1,129
Change the time to the next 5 minutes and get a reply earlier ;)

BTW, I don't know if editing crontab itself is the best way. You may want to use

crontab -e

to edit but beware that you may have to use vi comannds :o
 
Last edited:
Back
Top Bottom