Search code examples
linuxcronubuntu-server

linux cron job isn't running


I have a Ubuntu Server 10.

At the root cron I have a script to run every day at the same hour.

Running the script manually it's run fine, but in the cron it doesn't run.

At the syslog I got this:

Aug 23 09:22:01 database CRON[6884]: (root) CMD (./bkp.sh >> /tmp/bkp.log)
Aug 23 09:22:01 database CRON[6883]: (CRON) error (grandchild #6884 failed with exit status 2)

I found the possible source of the problem, I added some LOGs (echo) in the script...

During script execution, it exits on a "function" definition...

It seems that I have no access to command "function"

How can I solve this?


Solution

  • Here's a link i got while googling for 'cron environment variables'. It may help. There are many others like it :)