Was trying to edit my crontab after making some changes to my .bashrc file and came across this strange error while saving
crontab: temp file must be edited in place
You can solve this in one of two ways
1) Use vi as your editor (EDITOR=vi crontab -e)
2) Set some special flags set in your vimrc to allow crontab editing to work properly
In your bashrc or where ever you store your aliases (I use a separate .aliases/commands config file that I source from .bashrc)
alias crontab=”VIM_CRONTAB=true EDITOR=vim crontab”
and then in your .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Lets get crontab editing working | |
if $VIM_CRONTAB == 'true' | |
set nobackup | |
set nowritebackup | |
endif |
Thanks! Worked perfectly!