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!
You can also do it without a temporary file:
(crontab -l ; echo "0 4 * * * myscript")| crontab -
Use crontab -l > file
to list current user's crontab to the file
, and crontab file
, to install new crontab.
If your crontab is empty you should use 2>/dev/null
:
(crontab -l 2>/dev/null; echo "0 4 * * * myscript")| crontab -
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With