Is it bad to edit cron file manually?
Solution 1:
If you modify the user file under crontabs, it should work. However, there are two issues to take into consideration:
- If you mistyped the cron entry in the file, you will not be warned as opposed to using
crontab -e
command. - You can not edit your user file under crontabs directly without login as root or using sudo. You will get permission denied error.
Edit
One more point to add. When you edit the file directly, you may be warned by the text editor if you opened the file twice (two users accessing the same file). However, the cron list will be overwritten when using crontab -e
from two different shell sessions of the same user. This is another difference.
Solution 2:
If I understand correctly, you are editing the file manually with a text editor because you don't want to use crontab -e. I'll guess that's because it's using vi as the editor and you are unfamiliar with it.
You change crontab -e (and other things that need an editor) to use the more familiar nano editor by running
export EDITOR=nano
before
crontab -e
You can make nano the permament default editor by editing your ~/.bash_profile file to include export EDITOR=nano
at the end.
To answer your question, you should not edit the file directly because it might be overwritten without you knowing it. The 4th line says what it says because it comes from the crontab that you are supposed to manually edit (it would say that as the first line).