Linux – How to save a cronjob on nano editor

cronlinux

I can login to nano or vi through Putty to my web server.

After opening nano editor by typing crontab -e, I enter the following.

# m h dom mon dow command (this comes up always at the top)

*/30 * * * * wget -q -O /dev/null  http://mywebsite.org/admin/cron.php

However I am uncertain what I need to do after this.

Q1. Do I need to save it? If so, how to save this file?

I can't find any command to save. There are ^Get help, ^Writeout etc.

At the top of the screen, it says the following.
GNU nano 2.0.7 File: /tmp/crontab.Q1SgwM/crontab

Q2. Is this the place where this cron is stored? Then how can I open it if I want to edit/change?

Q3. Is that all I need to do? Is the cron starting automatically?

Thanks in advance.

Best Answer

You just have to type crtl-X then Y to confirm then Enter to accept the default writing path.
File will be written in the temporary directory but crontab will manage to put it in the right place.
You can then type crontab -l and see that your line have been saved

Related Topic