Editing crontab file in VIM (not saving)


I am trying to edit the crontab file to allow a backup to happen everyday and I cannot seem to get my changes to save, i get the following…


This is what I am trying to do inside the file…

Also I was not paying attention when following a tutorial and changed the crontab editor to VIM instead of using nano so this is most likely me not knowing anything about how VIM works. I tried changing back to nano without success

The message mentions an error in the file so I don’t think it’s a problem with either VIM or nano as they are simply text editors.

You will need to find what the error in the file is.

See this topic:

There are many spaces missing in that line.


Here is how the editor is determined when using crontab -e.


This option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. After you exit from the editor, the modified crontab will be installed automatically.