I have a shellscript in /etc/myprog/myscript.sh that I would like to run every week. Therefore I created a symbolic link in /etc/cron.weekly:
root@ip-10-190-199-197:/etc/cron.weekly# ls -ltr
total 8
-rwxr-xr-x 1 root root 895 2011-07-27 11:32 man-db
-rwxr-xr-x 1 root root 730 2011-09-24 14:55 apt-xapian-index
lrwxrwxrwx 1 root root 31 2011-11-17 05:36 myscript -> /etc/myprog/myscript.sh
To test it, I did:
cd /etc/cron.weekly
sudo ./myscript
It works perfect. However, the cronjob never actually runs for some reason. Do I need to do anything to activate cron.weekly?
The contents of my /etc/myprog/myscript.sh is:
cd /var/log/myprog/
/etc/myprog/updatescript.sh 1> `date '+/etc/myprog/logs/%Y-%m-%d-cran.log'` 2> `date '+/etc/myprog/logs/%Y-%m-%d-cran-warnings.log'`
/etc/myprog/myscript.shfile owned by root? Do you see any messages in syslog when the job is supposed to run? Have you tested running it hourly or some other time frame than weekly? – arrange Dec 31 '11 at 11:40