How do I edit crontab files in FreeBSD?$ crontab -e# ... I do my thing in vim & :wqcrontab.9ZcXiFaawt 6L, 203C writtencrontab: temp file must be edited in placeExit 1Using EDITOR=nvi works fine... Linux also seems to work fine...
How do I edit crontab files with Vim (I get the error: 'temp file must be edited in place')
save;unix
The problem is how Vim writes files. By default, it makes a copy of the file and overwrite the original one.You can observe this with:# Show the file's inode$ ls -i a3156153 a# Open file in Vim, :wq# inode changed!$ ls -i a3155322 acrontab gets confused by this (see :help crontab)You need to use :set backupcopy to yes to make Vim overwrite the original file:yes   make a copy of the file and overwrite the original oneYou can do this automatically for crontab files with:au FileType crontab setlocal bkc=yes