Problem is, when I execute "crontab -e" to edit current crontab file I don't get editor window.
I get something like this:
bash-2.05$ crontab -e 135
My problem is that I don't have EDITOR environment variable set.
I have to do something like this:
bash-2.05$ export EDITOR=vi bash-2.05$ crontab -e #Then I will receive proper output to edit crontab file 30 21 * * * /opt/oracle/product/9.2.0/local/script1 30 22 * * * /opt/oracle/product/9.2.0/local/script2
To avoid this problem happening any more I will add EDITOR environment variable in my ".profile" file:
bash-2.05$ cd ~ bash-2.05$ vi .profile #!/bin/ksh set -am -o vi export ORACLE_BASE=/opt/oracle export ORACLE_HOME=/opt/oracle/product/9.2.0 export PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib export EDITOR=vi export ORACLE_SID=db exec bash
Now, every time I login on this machine environment variable for EDITOR will be automatically set and I won't have problems with "crontab -e" any more.
Cron is a unix, solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon. These tasks are often termed as cron jobs in unix , solaris. Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times.
ReplyDeleteGood post, thanks for the tip.
ReplyDeleteThanks for the post - noticed that:
ReplyDeleteexport EDITOR=vi
gave an error
EDITOR=vi: is not an identifier
so:
EDITOR=vi
export EDITOR
albeit didn't get as far as adding it to .profile
Yes, if you're using Solaris sh then this two steps are needed.
ReplyDeleteYou can also add this two steps in .profile.
Thanks for comment!
Regards,
Marko
Thank you! Very helpful.
ReplyDelete