Gentoo Archives: gentoo-user

From: Nick <gentoo-user@××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Sync and glsa-check from cron
Date: Wed, 20 Jun 2007 14:06:37
Message-Id: 20070620140403.GI5658@cutie1.lan
In Reply to: Re: [gentoo-user] Sync and glsa-check from cron by Alan McKinnon
1 On Wed, Jun 20, 2007 at 09:50:04AM +0200, Alan McKinnon wrote:
2 > On Wednesday 20 June 2007, Nick wrote:
3 > >
4 > > So, I'm planning to run "sudo emerge --sync" and "sudo glsa-check -f
5 > > new" from a cron job, perhaps once a week.
6 > >
7 > > I can set up the sudoers part all fine, but is there anything I
8 > > should watch out for / consider when running these maintenance tools
9 > > from a cron job?
10 >
11 > Why bother with sudo and /etc/sudoers? That's just an extra layer of
12 > unnecessary complexity. The usual assortment of cron daemons can all
13 > run commands as root. Write a script to run the commands you want, copy
14 > it to /etc/cron.d/weekly. It will run at 4:22 am every Sunday.
15
16 Sounds good, I'll do that. For some reason I was under the
17 impression that root couldn't have its own crontab. Clearly I was
18 mistaken (just as well, that wouldn't make much sense...)
19
20 > You'll have to be aware of the usuaal limitations of cron jobs - they do
21 > not run under bash, and they seldom have the same environment variables
22 > set as what a r\egular user gets. So always include full paths to any
23 > command you run
24
25 I'll probably be back here if I some variable reassignments or
26 whatever cause things to get confused, but it doesn't sound likely.
27
28 Thanks guys,
29
30 -Nick
31
32 --
33 GPG Key : www.njw.me.uk/nick.gpg.asc GPG Key ID: 04E4653F
34 GPG Fingerprint: 9732 D7C7 A441 D79E FDF0 94F6 1F48 5674 04E4 653F