to capture the error and also ...can you try to enclose the whole command with in
()
---------- Post updated at 07:42 PM ---------- Previous update was at 07:27 PM ----------
found some information which can be useful
cron will email you the output of any program it runs (if there is any output). So, if you don't get any output, there are basically three possibilities:
crond could not even start a shell for running the program or sending email
crond had troubles mailing the output, or the mail was lost.
the program did not produce any output (including error messages)
Case 1. is very unlikely, but something should have been written in the cron logs. Cron has an own reserved syslog facility, so you should have a look into /etc/syslog.conf (or the equivalent file in your distro) to see where messages of facility cron are sent. Popular destinations include
/var/log/cron, /var/log/messages
and
/var/log/syslog.
In case 2., you should inspect the mailer daemon logs: messages from the Cron daemon usually appear as from
root@yourhost
. You can use a
MAILTO=...
line in the crontab file to have cron send email to a specific address, which should make it easier to grep the mailer daemon logs. For instance:
In case 3., you can test if the program was actually run by appending another command whose effect you can easily check: for instance,
I have corrected the \\ into \; and captured the errors too.
Of course, you are assuming that it is being called at all. Consider stoping your cron process. It should re-start and re-read your crontab file. You are editing the file with crontab -e aren't you? Changing the clock can also upset the cron process.
I would not worry about restarting cron on AIX. You will find that it is defined as a respawn process in /etc/inittab, so if you kill it off, the init process will start another.
What do you get in mybug.log by the way? Is this from the command line, a cron run of a script or a cron run of the command, or is that not firing at all?