DarkLeafyGreen
DarkLeafyGreen

Reputation: 70416

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?

Upvotes: 2

Views: 8621

Answers (1)

int0xff
int0xff

Reputation: 96

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

Upvotes: 6

Related Questions