Script runs manually, but cron fails

Bryan bryanvick at gmail.com
Fri Jul 24 17:11:02 EDT 2009


I have a backup script that runs fine when I run it manually from the
command line.  When I run it with cron, the script stops running at
random points in the source code.

The script calls rsync with the subprocess module, which in turn uses
ssh to backup files from a box on my lan.  It also uses the atexit
module to always run a certain piece of cleanup code when the script
exits.  However, this piece of code is never called when I use cron to
run the script, but a ps -A command also does not show the python
process so I know the script is dead.  The log files generated by the
script all show rsync as completing, but then the logging gets cutoff
at random places when the script dies after that point.  I am not
getting any email from cron complaining of an error either.

The script runs fine in my bash shell, what could cron be doing to
interfere?






More information about the Python-list mailing list