Appending to crontab with a shell script on Ubuntu

Filo Stacks picture Filo Stacks · Dec 20, 2011 · Viewed 37.2k times · Source

I'm trying to add a line to the crontab on Ubuntu.

Right now, I'm doing crontab -e and editing the crontab there.

However, I can't seem to find the real crontab file, since crontab -e seems to give you a temporary working copy.

/etc/crontab looks like the system crontab.

What is the path of the crontab that crontab -e saves to?

Thanks!

Answer

jeroent picture jeroent · Apr 17, 2013

You can also do it without a temporary file:

(crontab -l ; echo "0 4 * * * myscript")| crontab -