Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Cron and disabling emails for one script only
Date: Tue, 06 Apr 2021 20:29:01
Message-Id: 20210406212846.78dc2503@digimed.co.uk
In Reply to: Re: [gentoo-user] Cron and disabling emails for one script only by Dale
1 On Tue, 6 Apr 2021 14:42:28 -0500, Dale wrote:
2
3 > > cron only sends an email if the job produces any output. If the script
4 > > follows the *nix principle of succeed quietly, fail noisily, you
5 > > should only get emails when things go wrong. However without seeing
6 > > your mail-backup script, it is hard to say what needs to change.
7 > >
8 > > The "|| true " part means this cron task will always return success,
9 > > even if the script fails, which possibly is not what you want.
10 > >
11 > >
12 >
13 >
14 > My script, if one wants to call it that, just has rsync commands in it. 
15 > It doesn't get fancy.  I literally copy the commands from Konsole and
16 > paste them in my text file.  I make it executable and that's my script. 
17 > I wouldn't even think it rises to a bash thing even tho it is at the
18 > top, cron likes it that way.  For years, I been doing it manually.  I
19 > just wanted to automate the thing a bit. 
20
21 But what are the rsync commands and what information does cron mail you?
22
23 Without this information, we can only make wild guesses as to what is
24 going on. As a first wild guess though, rsync has a --quiet option that
25 means it only outputs error messages, are you using this?
26
27 As John said, your cron script only calls the backup script, so you may
28 as well put that in cron.hourly.
29
30
31 --
32 Neil Bothwick
33
34 ...Advert for restaurant:
35 "Exotic foods for all occasions. Police balls a speciality."