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

Re: creating and logging a daily cron job



michael wrote:

> On Tue, 2008-10-14 at 14:18 +0100, Dave Ewart wrote:
>> 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.
> 
> this doesn't seem to be true.... the job runs and produces output and
> root mail is (via /etc/aliases - thanks to Doug!) sent to me but yet I
> don't get any o/p from /etc/cron.daily jobs whereas I do from all my
> crontab jobs...

I think the *.sh extention is what's wrong, try removing it. just name the
script backup. That's what I did and it suddenly worked and is working
since 4 years ago.
I did it on sarge, which is still the main server os for me.

regards


Reply to: