A story of cron, svn, and STDERR.

Ken D'Ambrosio ken at jots.org
Sun Nov 1 07:40:29 EST 2009


Hey, all.  I ran into an interesting problem that drove me outright
bonkers and thought I'd share the insights for those who might run into
similar issues.  Most of my Subversion repositories I just back up via
straight flat file; one, however, being sent off-site, needs to be backed
up weekly via "svn dump".  I wrote a small script that does the dump and
then compresses it.  Tried it from the command line, and it worked like a
champ.  Plugged it into cron, and it would get somewhere between 40 MB and
65 MB in (out of 2.4 GB), and die.  No obvious rhyme or reason.  Clearly,
it wasn't a permissions or path issue, or I'd get 0 MB in.  Finally, in
attempting to re-direct STDERR to a log file... I fixed it.  *BY*
re-directing STDERR to a log file.  Apparently either cron or svn really,
really wants STDERR (even though no error was being thrown!), and this
machine didn't have an MTA installed.  At some point, I guess cron or svn
goes to open up STDERR, for whatever darn reason, can't, and dies.  Either
installing an MTA (the smart move) or re-directing 2> *anywhere*, did the
trick.

(For the record, running strace with "-f" on cron, and trying to get
through everything generated by a 45 MB svn dump, is an unhappy task.)

-Ken



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the gnhlug-discuss mailing list