Long cronjobs terminate after 2 minutes/Ubuntu 8.10
Erik Hemdal
erik at comprehensivepower.com
Fri Mar 27 13:53:09 UTC 2009
I use a cronjob to backup several directories on a Ubuntu 8.10 system. This
is done by a shell script which issues a series of commands on each of
several subdirectories.
When I run the script in the foreground, it takes about 2 hours to complete,
and it runs successfully. When I run it in a cronjob, it terminates
silently without an error after running for about two minutes. I know the
duration because of timestamps on the files that the job creates. The last
file written is done 2 minutes after the job starts, then nothing.
I can see that the cronjob begins because I see its entry in
/var/log/syslog. The top command displays the job running, until it dies.
I've already verified that the script is executable, that the full path to
the script is given in /etc/crontab, and that the full path to each command
in the script is also specified. I'm running the script as root. And there
is an empty line at the end of my /etc/crontab file (this was mentioned in
one forum post I found as a requirement for cron to work right). I've tried
running the job with nohup to try to keep it alive. Nothing has been
successful.
Other brief cronjobs that I run under similar conditions work correctly, but
they take less than two minutes each to go.
I've found many posts about cronjobs that won't run at all, but I didn't
find one about jobs that get cut short. I can't think of anything else to
try to get this to work. Is there a known way to make this work on Ubuntu?
Thanks for any advice or ideas. Erik
More information about the ubuntu-users
mailing list