I logged to remote computer, running under Solaris, using Putty and added some jobs to be run by cron. When I quit console and logged once again all jobs was lost.
crontab -l myuser
How do I persist jobs to be run even after I quit console?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityALWAYS use crontab -e
to edit your cronjobs. And remember to save and quit when exiting your editor. When the editor quits, it will tell you if there is an error preventing it being moved to the active set of cronjobs.
If you are using crontab -e
, you are not correctly exiting you editor to make your changes persist.
To exit the editor, do not close the putty screen.
If your editor is VIM or VI the keys needed to exit are ESC :wq
If your editor is EMACS the keys needed to exit are Ctrl+x Ctrl+c
If your editor is Nano the keys needed to exit are Ctrl+x y Enter
After you exit your editor you should either see an error or crontab: installing new crontab
. IF you see the latter, you can type crontab -l
and you should see your cron jobs. This will persist upon exit.
If you see an error, then fix the error and try again.
crontab -l myuser
, logged out, logged in again, rancrontab -l myuser
again and the outputs were different?