Forum Moderators: bakedjake
My ISP allows cron jobs, and I am trying to do my first one, but it's not working. I have an executable shell script called "bkp". Its path is /home/myaccount/www/bkp. Here's the script:
cd /home/myacount/www
theArchive="mydir."`date +%y%m%d`".tar"
tar cfp $theArchive mydir
gzip $theArchive
chmod 400 $theArchive.gz
The script works fine from the shell prompt, but I can't get it to run as a cron job. I created a file called "mytab" in the same directory:
13 0 * * * /home/myaccount/www/bkp
...to test it at 13 minutes past midnight, which was a couple of minutes away when I ran the test. Then I typed:
crontab mytab
Next I did a "crontab -l" to make sure it took, and it echoed back the contents of "mytab".
However, 13 minutes past midnight came and went, and the job didn't run. The .gz file did not get created. Any idea what I'm doing wrong?
Thanks!
Perry