in reply to Manipulating crontab
On Linux and Slowlaris, crontab is in /etc/crontab
Take a look at it, i would suggest using perl -i to swap out the lines that you want to change. The script will have to be run as root of course. Man crontab will give you the encoding of the time info.
Hope this helps,
-malloc
UPDATE: just read Scains's two posts, i am too used to my personal system administration to know how to do things the right way i guess :) i just couldn't think of how you could interact with crontab -e via your script. But yeah, don't use roots crontab unless absolutely necessary, thanks for the catch Scain.
Re: Re: Manipulating crontab
by scain (Curate) on Jun 21, 2001 at 20:09 UTC
|
malloc,
Why do it as root? Generally, you shouldn't be editting /etc/crontab
directly; you should instead use /usr/bin/crontab to edit it,
or to replace the existing cron information with a file, as I
suggested above. Using /usr/bin/crontab lets the script run as
the owner of the crontab information.
Scott
| [reply] |
|