Script runs manually, but cron fails

Bryan bryanvick at
Mon Jul 27 10:37:53 EDT 2009

On Jul 24, 2:11 pm, Bryan <bryanv... at> wrote:
> 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?

This script works when I run it at home, and I think it is because I
don't use rsync's ability to backup over ssh.  The working script at
home simply backs up the local machine to a mounted external hard
drive.  So when I run a python script that calls rsync to work over
ssh, cron is screwing things up.  Can anyone recommend where I should
report this behavior?  Should I email the author of cron directly, I
don't see a group/address specifically for cron bugs.

More information about the Python-list mailing list