cron - How to save the file after typing "crontab -e" -
I open the file in the terminal via crontab -e
and now I want to save it . I have tried many things, like : wq
or Ctrl-X , but it did not save the file. How can I do this?
crontab-A
command is your default editor, which is one of the following :
-
$ visual
command specified by the environment variable (if it is set); Or - the order specified by
$ EDITOR
; Or -
/ usr / bin / editor
The latter is a symbolic link for some editors. On Linux, the default appears on the nano
.
If it is the nano
, then there should be a 2-line menu at the bottom of the screen. Type Ctrl-X to exit; If you have modified the file, you will ask if you want to save it.
If you have a favorite editor, you should set both $ visual
and $ editor to
the order used to implement it For example, I have:
exported EDITOR = vi export view = $ EDITOR
My $ HOME / .bash_profile
In .
This system that I am using, applies to a recent Linux system with Vixie Cron implementation. If your system is quite different, then all this is not necessary.
Man Crontab
should explain how the crontab
command works, if not, then there is documentation too.
(By coincidence, I place my code in a separate file under my home directory, which holds it in a source control system, allowing me to keep track of changes and return to work. If the version gives me something wrong, with the crontab -e
, making mistakes is easy and it is difficult to recover from them.)
Comments
Post a Comment