[Techtalk] logging output from dump

Conor Daly conor.daly at oceanfree.net
Sun Apr 28 22:44:27 EST 2002


On Thu, Apr 25, 2002 at 01:15:06PM +0000 or so it is rumoured hereabouts, 
Jen B thought:
> 
> 
> hopefully this is a quickie...
> 
> I'm running my backup using dump from cron and rather than
> having STDOUT mailed to root as I currently do, I would like to
> have it write to a log.  I thought the following command
> would do it:
> 
> /sbin/dump 0 -f /dev/st0 /mybackupdir | tee -a /var/log/backuplog
> 
> the log file is created, but contains nothing. Shouldn't
> this do the trick? Any other equally concise suggestions?
> 
> I can whip up a script to do this without a problem.
> I was just wondering if "tee" didn't work with cron jobs
> or something weird like that.

Alas, I dunno about tee but one other option is to use a procmail recipe
to stuff the mailed output into the logfile

:0:
* ^Subject: Output from your CRON job
| cat >> /var/log/backuplog

You'd need to include a check for the command invoked so you don't end up
sending *all* your cron output to this logfile.

Conor
-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)
---------------------
Faenor.cod.ie
 11:39pm  up 7 days,  5:18,  0 users,  load average: 0.00, 0.00, 0.00
Hobbiton.cod.ie
 10:39pm  up 5 days, 13:05,  1 user,  load average: 0.02, 0.06, 0.06



More information about the Techtalk mailing list