Operating System - HP-UX
1830939 Members
2777 Online
110017 Solutions
New Discussion

need to freeze system date/problems with cron

 
67Spyder
Occasional Visitor

need to freeze system date/problems with cron

I have a server running an OLD ERM system.  In 1990 the ERM system, which uses a 2 digit date, was made "Y2K ready" by adding a little math to postpone the problem to 2020.  My client made me aware of this November 2019 LMFAO! We successfully got them using a new system in time but need to keep the old system running so they can close the financial year and refer to the old system.  As the system conciders any date past 2019 invalid we want to keep the date from advancing past Dec. 30 2019 (keeping the 31st as a safety).  I created a simple script that sets UNIX_STD=2003 to prevent date from complaining about setting the date backwards then sets the date to Dec. 29 2019.  Cron runs this script at one minute to midnight every day.  This works except cron fails every few days and needs to be restarted.  Yes, I know this should have all been figured out in a test environment a year ago but I just don't have those resorces.

4 REPLIES 4
KishJ
HPE Pro

Re: need to freeze system date/problems with cron

We need identify why the cron is failing. Any entries in syslog.log or cronlog?


I am a HPE Employee

Accept or Kudo

67Spyder
Occasional Visitor

Re: need to freeze system date/problems with cron

After looking at /var/adm/cron/log I think I have some clues.  Yesterday I had to manually reset the date as cron had failed.  My steps at 3:45am were to stop then start cron and then reset the date to Dec. 30.  Upon examining the log file today I found that cron functioned for about 2 hours after being restarted but erroneously recorded the date as Dec. 31 even though the date was immediately set the the 30th after restarting cron. There were no errors recorded the entries just stopped. Today I restarted cron AFTER resetting the date, I will monitor the log file to see when if it works longer.  My suspision is that I will have to restart cron at 1 minute after midnight on the morning of the 30th.

67Spyder
Occasional Visitor

Re: need to freeze system date/problems with cron

Possibly solved: Cron appears to create between 0 and 1 log entries with an out of sequence date, then it stops logging.  Cron appears to fail completely some time after it stops logging (it does about 8 things per hour and works without logging for at least 2 hours).

Solution: My script that rolls back the date at 23:59 now also then sleeps for 2 minutes then stops and restarts cron so all logging is done dec. 30

KishJ
HPE Pro

Re: need to freeze system date/problems with cron

Greetings,

I am glad to know to that you figured out the cause and fixed it. 

Thank you for sharing the details.


I am a HPE Employee

Accept or Kudo