1. 程式人生 > >錯誤crontab: "/bin/vi" exited with status 127

錯誤crontab: "/bin/vi" exited with status 127

想使用crontab新增計劃任務,

$ crontab -e

出現錯誤如下:

no crontab for root - using an empty one
/bin/sh: /bin/vi: No such file or directory
crontab: "/bin/vi" exited with status 127

原因:系統沒有安裝 vi

解決方法1:安裝vi

$ yum install vim-minimal -y

解決方法2:設定 vim 為預設編輯器

$ echo "export EDITOR=vim" >> ~/.bashrc
$ source ~/.bashrc