I recently installed a copy of CentOS on my server. Things 'seem' to
be running ok. I have noticed one thing though. If I make any changes
to the cron using the 'crontab -e' command, I must restart the 'crond'
process, otherwise my scripts are not executed.........
Any thoughts? Once I restart the cron, the everything executes just
fine.......
Thanks for your help.
I experienced, that if I make changes to cron, it needs more than
one minute to pick-up the changes. So if I put something into the
cronfile saying "55 15 ..." and do it at 15:54, then it won't get
executed.
Try "56 15 ..." or even "57 15 ...". I know, it is a pain in the ass.
Vilmos
> Hi All,
>
> I recently installed a copy of CentOS on my server. Things 'seem' to
> be running ok. I have noticed one thing though. If I make any changes
> to the cron using the 'crontab -e' command, I must restart the 'crond'
> process, otherwise my scripts are not executed.........
Clarify "the cron" - there is never just one.
If you mean the system crontab, you can only edit this under controlled
circumstances - as root, and with a text editor.
You cannot run crontab -e on the system crontab - you will be editing root's
personal one.
Restarting the cron *server* is utter insanity - it runs every minute and
looks through all crontabs and directories to see what needs to be done.
It very rarely crashes, and never *needs* to be restarted for any reason
short of armageddon.
If what you actually want to do is run something from the system at a
certain time, just write a file with the cron job, make it executable, and
dump it in /etc/cron.d/ - it will get picked up fine.
Unless RHEL doesn't use that scheme, of course.
In which case they should.
--
All your bits are belong to us.
Or dump them in /etc/cron.{hourly,daily,etc.}. I really like that
approach to creating new cron processes so that they get executed in
sequence with other cron jobs, to prevent things like "updatedb"
soaking up cycles and CPU needed by a dump process.