Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a situation and want some advice please. So basically we a batch scheduling system at work and we are implementing a full migration from one clients system which is on HP-UX to RHEL. This involves migrating 2500 shell scripts, setting up the scheduler and importing all these scripts.
Anyway, these scripts rely on a financial data feed which we cant provide in our SIT environment and can only have a "cut" of data from the client to run against the scripts. Problem is, these scripts need the data to be within 3 days old or the code wont complete. (Its a criteria for this finance data). So I have been asked if I can set the test box up with the system date set constantly on a certain date. ie. It will never change from 20140513.
Unix-like systems have a history of sometimes reacting badly to large negative time shifts (timeouts that should be a few seconds don't trigger for a long time, etc.), so you might need to reboot with the BIOS date set to that certain date (and of course with NTP or other time synchronization tools disabled). Sometimes it works OK, just don't be too surprised if some parts of the system misbehave after you've set back the date on a running system.
Setting time on boot with a script may work. Not sure how this would affect your data however. Even changing date one time may cause some unexpected results.
At one time I explored a way to stop time (rtc) in order to get past some of these issues. It was a long time ago and may not be possible anymore.
The hardware clock is only consulted during boot. You can certainly run "hwclock --systohc" after setting the date. Many (most?) distros do that during shutdown, so if you do find that a reboot is needed, setting the date and then rebooting should take care of it.
However you do it, you will of course be left with various files/filesystems with timestamps in the future. Working around or resetting those is left as an exercise for the student sysadmin.
Resetting the time can have serious consequences. What kind of scripts are these? How are they getting the date? Couldn't you modify the function(s) that provide the date to return a static date every time it's called? System wide date reset is probably best done through a cron job, and I feel it's a bad idea. I wouldn't do it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.