- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: change system time via crontab?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 08:06 AM
07-27-2004 08:06 AM
I have a shell script which I want to run by crontab :
like
start:
#!/usr/bin/sh
date 07311600
end
to change date of server to July 31 2004 and I set job to run at
00 16 * * 2 /usr/local/bin/timescript
However the system time does not change.
Why would that be?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 08:28 AM
07-27-2004 08:28 AM
Re: change system time via crontab?
You can inadvertantly cause a loop.
Best that be done manually or via ntp(network time protocol).
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 08:51 AM
07-27-2004 08:51 AM
Re: change system time via crontab?
wouldn't running
00 17 * * 2 /usr/local/bin/changetimescript
changetimescript:
date 07311700
provide a more accurate time change than doing typing command
date 07311700 at 16:59:50 from keyboard?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 09:55 AM
07-27-2004 09:55 AM
Re: change system time via crontab?
If you have databases on your system, they don't take too kindly to have the time changed, forwards or backwards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2004 03:55 PM
07-27-2004 03:55 PM
Solutioncron will be working based on time and date informations. If we change the time and date with a script, in a cronjob, it will make effects on other jobs and crontab too.
I have checked the accuracy of date change on command line as,
# time date 073117342004
unable to write utmps record to wtmps database
unable to write utmps record to wtmps database
Sat Jul 31 17:34:00 PDT 2004
real 0.0
user 0.0
sys 0.0
It cannot write time into logs. But the amount of time needed to change the date and time is in 1 second (average) period only. So you can very well proceed on shell with super privillaged user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2004 12:53 AM
07-28-2004 12:53 AM
Re: change system time via crontab?
http://www.ntp.org
all you should have to do is create a /etc/ntp.conf with a single line similar to the following
Server SourceNTP.Server.net
where sourcentp.server.net is the ip or DNS name of a NTP provider, probably within your company.
then start the deamon (/usr/local/bin/ntpd if i am not mistaken) and let it adjust the time.
as for accuracy, i have close to 400 NTP clients in this building, and none of them are more then 10 ms off from the atomic time.