As a general rule, it's not good practice to edit the crontab directly using crontab -e in case of slipups and typos which would cause the crontab not to work thereafter.
That said, we all do it! However, for safety it's best to do:
crontab -l > crontemp
edit crontemp to make your change
crontab crontemp - to activate the change.
If there are errors, the crontab won't be changed and you'll be warned that this is the case. Just re-edit crontemp until the change is accepted.
I dont like to use crontab -e to edit my cron files. What I do is vi it manually, then you have to stop and restart the cron to make your changes. vi /var/spool/cron/crontabs/username - make changes
/etc/init.d/cron stop && /etc/init.d/cron start
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.