Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Manipulating crontab

by malloc (Pilgrim)
on Jun 21, 2001 at 19:59 UTC ( [id://90431]=note: print w/replies, xml ) Need Help??


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.

Replies are listed 'Best First'.
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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://90431]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 19:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found