> From: opensolaris-discuss-boun...@opensolaris.org [mailto:opensolaris-
> discuss-boun...@opensolaris.org] On Behalf Of Forrest Aldrich
> 
> I ran into an unfortunate problem with cron recently, where I had
"assumed"
> that a HUP signal would cause it to re-read a new crontab entry.   The
result
> was a script was run that deleted some data.

When you modify a crontab entry, there is no need to HUP anything.  You just
wait for the next minute that the script is supposed to run (under some
circumstances you have to wait for the 2nd minute) and that's it.


> # /etc/init.d/cron stop (then start)
> But this is Solaris, so we might use:
> svcadm restart -t system/cron:default

Why would you want to do that?


> Running crontab -e is not applicable to what I'm doing here.  I
experimented
> with it and it turns out you can't use that functionality in a scripted
> environment, it doesn't work.    I have a script that edits a line of a
crontab,
> either commented out or not.  Then it needs to tell cron to re-read the
tabs.

Sure you can script that.  In fact, I do.  You just set your EDITOR to
something you control...  EDITOR will be launched with the name of the temp
file as an argument, so it can edit that file and save it and exit.  And
then crontab will save that file as the crontab entry (assuming it passes
syntax.)

_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to