- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: easy unix time change
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
Discussions
Discussions
Forums
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
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
тАО12-18-2003 03:56 AM
тАО12-18-2003 03:56 AM
My memory is tricking me. I knew a way in solaris to change the date/time of a system in the shell of a user.
The machine time itself is still alright but it can be ahead a day or two for a sub-shell. ( I'm writing a script that delete log files after n-days, thats why I need this ).
It was only a matter of setting an environment variable ( TIMEZONE ? TZ ? ).
Somebody knows ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 04:02 AM
тАО12-18-2003 04:02 AM
Re: easy unix time change
You shoudld set up "ntp" and synchronize your time with a public "ntp" server.
Oh and remember to synch your hardware clock.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 04:18 AM
тАО12-18-2003 04:18 AM
Re: easy unix time change
Greetings, Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 04:23 AM
тАО12-18-2003 04:23 AM
Re: easy unix time change
Man rdate
ex: (just to see other node (time server) date/time
rdate -p 'remote_node'
J-P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 05:03 AM
тАО12-18-2003 05:03 AM
Re: easy unix time change
I just want to "emulate" the time in a user subshell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 05:25 AM
тАО12-18-2003 05:25 AM
Re: easy unix time change
What do mean by emulate in a sub-shell
J-P ( Is confused now !)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 05:32 AM
тАО12-18-2003 05:32 AM
Re: easy unix time change
Now I login on the machine. ssh user@mybox. Everything that I start in this sessions is "subshell", ie: everyting I run or do is a child/fork of the "bash" instance I created when I log on.
Now I want everything in this session to use a time ( `date` output for example ) different than the real time of the machine that the other users/process/daemon.
I know it sounds silly but it can be done, I already did it but I just dont rememeber how.
BTW, for a dumb you have many karma points ! ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 05:42 AM
тАО12-18-2003 05:42 AM
Re: easy unix time change
Now I really dont want to 'touch' some files. Wait 5 days to test my system. And wait until next tomorrow if something doesnt work.
I want to:
1 go backward 5 days,
2 'touch' some files.
3 Reset the good time.
4 Test my script.
5 And repeat if I made a mistake.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 06:01 AM
тАО12-18-2003 06:01 AM
SolutionWhy not just use touch to create the files with whatever date you want. Check the man page for touch for details, but something like the following should work for you.
touch -amt 200312011300 test.file
That should create a new file named test.file with an access and modified time of 1pm on Dec 1, 2003.
--
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2003 06:07 AM
тАО12-18-2003 06:07 AM