1847254 Members
3797 Online
110263 Solutions
New Discussion

Re: cron postpone

 
Michael Murphy_2
Frequent Advisor

cron postpone

Hello - does anyone have an elegant solution for the situation of shutting down all of cron jobs for a period - (without actually commenting out all entries) - and also playing "catch up" of the jobs after cron is re-activated? This is for system maintenance. Thanks
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: cron postpone

Hi Michael:

Instead of commenting out entries, simply move the entire crontab into a file divorced from the cron daemon; perform your maintenance; and restore the file to cron:

# crontab -l > /${HOME}/mycrontab
# crontab -r
...[maintenance occurs]...
# crontab ${HOME}/mycrontab

As for "catching-up", 'cron' isn't going to help you. You either ignore the event that went by, or you manually re-run the crontab entry (line).

Elegant? No. Simple? Yes.

Regards!

...JRF...
SKR_1
Trusted Contributor

Re: cron postpone

# /sbin/init.d/cron start <-- start cron
# /sbin/init.d/cron stop <-- stop cron

Thanks

SKR
Steven E. Protter
Exalted Contributor

Re: cron postpone

Shalom,

Sadly HP-UX does not have a atd daemon which will run cron jobs after the fact if the system is offline for some time. Linux does.

I'd just shut the daemon for a while and re-run what needed after the outage.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
SKR_1
Trusted Contributor

Re: cron postpone