I have created a script called "forward_email.sh" and set permissions to 777. It contains the following line:
echo "It worked: $(date)" >> /home/noc/email.log
I created a cron job with the following line:
*/5 * * * * /home/noc/forward_email.sh
The problem is that the "email.log" file never gets changed. I even set the permissions to 666. When I run the script manually, it works perfectly.
The cron job is running according to the "/var/log/cron.log" file.
Can someone point me into the right direction as to what might be going wrong? This is a minimal virtual machine install of Ubuntu Server 9.04 with cron installed via apt-get.
*UPDATE: I made a very stupid mistake. I named my script "forward_mail.sh". I wasn't until I installed some email services and got the following error email from Cron that I discover my mistake.*
/bin/sh: /home/noc/forward_email.sh: not found
I changed the name of the file, and it works now.