Setup a cronjob from commandline
I want to setup a cronjob to execute a shell script every 5 minutes on my ubuntu server. So I enter the following in the command line:
sudo crontab -e
That returns status code 137
and lets me edit the crontab in vi editor. I enter the following
*/15 * * * * myScript.sh
After that I enter ;wq
and I get following message:
crontab: "/usr/bin/sensible-editor" exited with status 1
开发者_运维百科Whats wrong? How can I enter a cronjob?
the correct sequence for exiting vi is
:wq
not ;wq
also, try changing the editor to something more user-friendly, e.g. nano
# export EDITOR="/usr/bin/nano"
# crontab -e
精彩评论