Edit crontab with text editor?

Is crontab -e the only way to edit crontab?

When I tried editing crontab with geany, it does not work.

Type select-editor and choose the editor you want to use,
then crontab -e will open with that editor. nano is easy.

Thanks, but why can I not use geany?

You can ... Per the man crontab page, if a VISUAL or EDITOR env variable is set, that will be used to edit crontab. So, export VISUAL=/usr/bin/geany then edit crontab with crontab -e

/usr/bin/select-editor is a script which pulls the defined editors from update-alternatives. You can add geany to the list with:

sudo update-alternatives --install /usr/bin/editor editor /usr/bin/geany 10

Then select -editor should list geany as one of the editors.

2 Likes