Hi,
I have searched for cron in these forums and can't seem to finds anyone who has a similar problem. Hope you can help!
I have a script called metadata.refresh that I would like to execute every five minutes. If I execute this script as root, it runs successfully, copying the webpage to local files (then cleaning up) - basically doing all it should:
Code:
#!/bin/sh
cd /root/downloads/SDSS
rm -f sdss-sites.*
rm -f sdss-trust.*
wget (website here)
wget (website here)
/usr/bin/siterefresh --out sdss-sites.xml --url (webpage)
/usr/bin/siterefresh --out sdss-trust.xml --url (webpage)
rm sdss-sites.xml
rm sdss-trust.xml
When setting up this as a cron job, I made the following crontab:
Code:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/metadata.refresh
When the cron job executes I get the following on ps -ef (ignorning irrelevant procs):
Code:
root 3345 1 crond
root 21654 3345 CROND
root 21655 21654 /bin/sh /usr/local/metadata.refresh
root 21656 21655 wget (1st webpage in script)
root 21657 21654 /usr/sbin/sendmail -FCronDaemon -i -odi -oem root
Why is this extra CROND process spawning (i already have a cron daemon)? I thought it was the mail part messing it up so I put MAILTO="" at the top of my crontab, then I get the same output above except the sendmail line is missing. I have tried piping the output ( /dev/null 2>&1) but this doesn nothing. I have also put an extra empty line at the end of the crontab.
I don't understand why the script runs perfectly when executed normally, but the cronjob can't complete it.
Any ideas?
Much obliged
Jbob75