[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: creating and logging a daily cron job



On Tuesday, 14.10.2008 at 14:55 +0100, michael wrote:

> > I suggest writing/rewriting backup.sh so that it writes its output
> > to well-defined files, rather than relying on the behaviour of
> > standard output/error.
> 
> I thought about this but presumed if there was an already set-up
> mechanism for cron jobs that would be preferable. Otherwise I'd also
> have to sort out how to manage my own logs for backup.sh output (not
> sure would want them rotated in case I'm away for over a week, say)

OK: why not rewrite the script to include calls to make the script use
syslog, then?  Take a look at the package 'logger'.  It works like this:

  logger -i -p syslog.info -t processname "Message goes here"

Dave.

-- 
Dave Ewart
davee@ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
University of Oxford / Cancer Research UK
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016

Attachment: signature.asc
Description: Digital signature


Reply to: