Saturday, March 10, 2007

Editing Cron through a script

This one is pretty easy ...

Basically, copy the current file to a temporary file. Then append the text from some_file. Finally, have crontab mv the file back to it's proper location.

crontab -l > /tmp/file
cat some_file >> /tmp/file
crontab /tmp/file

No comments: