Can not edit cronjobs file in Debian with crontab -e

cron

Solution

As one other person has suggested, vim is obviously the default editor on your new server. You can test this by running

EDITOR=pico crontab -e

Substituting whatever is your actual preferred editor (sounds like it may be nano or pico). If that works, you should try one of the following:

- edit your login script to set that environment variable on login (sets the editor just for that user)

- Make sure your favourite editor is is installed and run the following (as root): `update-alternatives --config sensible-editor`

You can then choose the default editor for all users (they can override it individually by doing option 1).

Problem

I have had several Debian servers and always edited cronjobs in this way: crontab -e and Ctrl+x Just got a new server and can not do it in this way anymore. When I enter crontab -e, the file opens but I can't write anything. I can move cursor up and down but can't write. I even can not exit from this file because Ctr+x doesn't work. When I open a file there is some information and the rest empty lines contain tildes ~ in the beginning of each line. Any ideas how can I edit this file? Thanks.

Original source