On Wed, Jun 20, 2007 at 09:50:04AM +0200, Alan McKinnon wrote: > On Wednesday 20 June 2007, Nick wrote: > > > > So, I'm planning to run "sudo emerge --sync" and "sudo glsa-check -f > > new" from a cron job, perhaps once a week. > > > > I can set up the sudoers part all fine, but is there anything I > > should watch out for / consider when running these maintenance tools > > from a cron job? > > Why bother with sudo and /etc/sudoers? That's just an extra layer of > unnecessary complexity. The usual assortment of cron daemons can all > run commands as root. Write a script to run the commands you want, copy > it to /etc/cron.d/weekly. It will run at 4:22 am every Sunday.
Sounds good, I'll do that. For some reason I was under the impression that root couldn't have its own crontab. Clearly I was mistaken (just as well, that wouldn't make much sense...) > You'll have to be aware of the usuaal limitations of cron jobs - they do > not run under bash, and they seldom have the same environment variables > set as what a r\egular user gets. So always include full paths to any > command you run I'll probably be back here if I some variable reassignments or whatever cause things to get confused, but it doesn't sound likely. Thanks guys, -Nick -- GPG Key : www.njw.me.uk/nick.gpg.asc GPG Key ID: 04E4653F GPG Fingerprint: 9732 D7C7 A441 D79E FDF0 94F6 1F48 5674 04E4 653F
pgpTArsCht9nD.pgp
Description: PGP signature