[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 13:22 +0100, michael wrote:

> If I wish to have, say, a backup script running daily by the system (ie
> with su privileges) and to have access to any std out/err output what's
> the recommended Debian way to do so?
> 
> I've tried
> a) create $HOME/bin/backup.sh script
> b) sudo ln -is $HOME/bin/backup.sh /etc/cron.daily
> 
> and it appears to run each day. However, I can't find where std out/err
> is going to - there's nothing in /var/log/syslog for example.
> 
> Note I don't want to receive mail for all cron jobs run by the system so
> I presume setting MAILTO in /etc/crontab is not the way forward.

I think the standard output for jobs run out of cron.daily will
typically go to root's mailbox.

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.

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: