Crontab Problem

Dear All

I have machine with SunOS APP5a 5.9 Generic_122300-19 sun4u sparc SUNW,Sun-Fire
With crontab like this :
59 23 * * * /home/lng/script/move_and_compress_logs_update.sh
But that crontab cannot running at that time. I run my script by manually, the result is fine.
What must I check at crontab problem? services..? or anything else..?

Best Regards
Jiman:b:

Change your cron entry to this and any errors should show up in mc.log:

59 23 * * * /home/lng/script/move_and_compress_logs_update.sh > /home/lng/script/mc.log 2>&1

I'm just assuming here but are you doing some sort of archiving of logs and moving them to a folder named according to the date on which the script runs? If so, and you are using the `date` command in your script, then there might be an issue with running the script at 23:59. Remember, the date changes at 00:00.

Taking a stab in the dark here....

If your job executes itself correctly on command line (interactive shell) but not using cron (batch), it is very often due to environment error: Have you loaded in your script all the ENV variables it needs for execution? One way to see if env is the problem is to execute your .profile in the beginning of your script:

. $HOME/.profile

But dont forget even HOME isn't set for cron... you will have to give full path...

What about to check cron logs first???

less /var/cron/log 

... and check root mail (assuming that this is a root cron).