Just a thought, in a cron job, where does stdout go and can it fill
up???
Chris Allen wrote:
Usually defaults to /var/log/messages. Maybe you'll see an error there. You might want to change it to:
tar -cvzf $OF /var/www/ /home/cvs > /tmp/some_logfile 2>&1
Interesting! There is a series of log files started called panic, which list a panic because exim.conf file can't be opened, each time at exactly when my backup is set to run. I haven't yet got exim set up correctly running and haven't had time to look at it. I've done the above to trap the error messages that can't get through. I'll keep you posted on the breathtaking results. (I assume that if the logfile doesn't exist it will be created? And I'll just blindly trust you on the "2>&1" thing.....) Thanks! Jenny.
On Tue, Mar 12, 2002 at 10:29:43AM +0000, Jenny_Hopkins@toby-churchill.com wrote:
Interesting! There is a series of log files started called panic, which list a panic because exim.conf file can't be opened, each time at exactly when my backup is set to run.
It could well be that this is cancelling the entire cron job including your backup.
I haven't yet got exim set up correctly
running and haven't had time to look at it.
perhaps disable it altogether??
I'll just blindly trust you on the "2>&1" thing.....)
Sorry - this means "redirect the standard error output (2) to the same place that standard output (1) goes"
- so it will send both normal output and error output from the program to the file you specified.
On Tue, 12 Mar 2002 11:30:26 Chris Allen wrote:
On Tue, Mar 12, 2002 at 10:29:43AM +0000, Jenny_Hopkins@toby-churchill.com wrote:
Interesting! There is a series of log files started called panic,
which
list a panic because exim.conf file can't be opened, each time at
exactly
when my backup is set to run.
It could well be that this is cancelling the entire cron job including your backup.
This is very likely.
The other crons I have seen re-direct the output of a cron job to a temporary file and then mail the file at the end.
The Linux cron seems to be different in that it runs the cron job with stdout and stderr pointing to a pipe. If the process reading the pipe closes it (this includes quitting) then the commands in the cron job will get a SIGPIPE signal when they try to write output to stdout or stderr. Unless the processes concerned have trapped or ignored this signal then it will kill them.
Steve.
Jenny_Hopkins@toby-churchill.com Jenny_Hopkins@toby-churchill.com wrote:
(I assume that if the logfile doesn't exist it will be created? And I'll just blindly trust you on the "2>&1" thing.....)
Yes, it will, and the 2>&1 says to send "standard error" to "standard output", thereby trapping errors as well as normal output.