[Techtalk] cron problem running a script

Devdas Bhagat devdas at dvb.homelinux.org
Wed Apr 13 09:37:57 EST 2005


On 13/04/05 00:13 +0200, Almut Behrens wrote:
> On Tue, Apr 12, 2005 at 05:26:40PM -0400, Angelina Carlton wrote:
> > 
> > So know I know cron is fine and the issue is with the difference
> > between running the rdiff-backup command from the command line versus cron.
> 
> Often this is due to differences in the environment -- things like
> different search paths for other tools run as subprocesses, libs,
> configs, whatever...  However, I don't know rdiff-backup well enough to
> come up with any specific suggestions.
> 
rdiff-backup is a Python application. http://rdiff-backup.stanford.edu/
I am looking at the source right now, and I can't find any environment
specific stuff. The only thing that _may_ be different is the Python
module path, but in that case the application should have died very
noisily.

> What I would try is to dump both environments, and compare the cron vs.
> the normal environment.  Sometimes, the problem becomes evident rather
> soon, once you look at the individual differences...
>
This is most likely not a $PATH issue.

> If that leaves you clueless, you might run rdiff-backup under strace
> (with -f to also track any forked processes), to get an idea of where
> exactly it's failing (e.g. if it doesn't find a file, a stat()/open()
> system call will fail, etc.).

Perhaps calling the application with #!/usr/bin/python2.3 -v will help.
alternatively, call it with the verbosity argument set to something  >
0.

/usr/bin/rdiff-backup --verbosity=4 .....

This writes to a file named backup.log at 
$backup_directory/rdiff-backup-data/backup.log

Looking at that may be helpful.

Devdas Bhagat


More information about the Techtalk mailing list