Script runs manually, but cron fails
J Kenneth King
james at agentultra.com
Mon Jul 27 16:40:53 CEST 2009
Bryan <bryanvick at gmail.com> writes:
> 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
Double check nothing is writing to stdout/stdin
Some cron's don't mind, but I always squelch output because some do.
More information about the Python-list