Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Cc: Mick <michaelkintzios@×××××.com>
Subject: Re: [gentoo-user] Receiving mail from crontab
Date: Wed, 05 May 2010 07:06:11
Message-Id: 201005050902.31630.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] Receiving mail from crontab by Mick
1 On Wednesday 05 May 2010 07:45:24 Mick wrote:
2 > On Tuesday 04 May 2010 23:40:20 Alex Schuster wrote:
3 > > Mick writes:
4 > > > I am getting a bit confused from the messages that I receive in my
5 > > > gmail account sent from my crontab.
6 > > >
7 > > > First, is related to the title which is:
8 > > > Cron <root@mylaptop> test -x /usr/sbin/run-crons &&
9 > > >
10 > > > /usr/sbin/run-crons
11 > > >
12 > > > I am not sure what this "test -x" part represents?
13 > >
14 > > It means: If /usr/sbin/run-crons is executable, execute it. It could also
15 > > be written as
16 > >
17 > > [ -x /usr/sbin/run-crons ] && /usr/sbin/run-crons
18 > >
19 > > or
20 > >
21 > > f=/usr/sbin/run-crons
22 > > if [ -x $f ]
23 > > then
24 > >
25 > > $f
26 > >
27 > > fi
28 >
29 > Thank you, I understand what the test does. What I am not sure is why this
30 > is printed on the title of the email. Where is what is printed on the
31 > email title controlled from? Is it editable?
32
33 It's cron's default. If it sends a mail, by default it does this:
34
35 The subject is the program field in the crontab
36 The body is the output from the program.
37
38 You can't normally change that. What you do is edit your called script to
39 intelligently mail you the information you do want, and send all output to
40 devnull to suppress cron's default mailer settings
41
42 --
43 alan dot mckinnon at gmail dot com