- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: set date variable to 1 hr behind
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-2006 03:31 AM
тАО12-18-2006 03:31 AM
This problem is a bit tricky for me to work out:
NHOST=`hostname`
WKPATH=/sysadmin/scripts/performance
SAPATH=/sysadmin/logs/performance
FDATE=`date +%Y%m%d_%H%`
I am searching for a performance file that is created then renewed hourly by a different script - the script I run must search for the date an hour previously. I could use ls |tail |grep etc however I have many files in the performance directory and do not wish to put unnessasary load on the system:
is there a way I can get the correct file by minus 1hr?? ie:
The file is created every hour at the same time run by cron:
lobster99_20061218_1601.tmp is moved to
lobster99_20061218_1601.tmp at 1701
I need to take into account for the 24hr clock so at 00:01 i need to process the file 23:01.
how can this be done?
many thanks
Chris
Solved! Go to Solution.
- Tags:
- date arithmetic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 03:41 AM
- Tags:
- TZ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 03:42 AM
тАО12-18-2006 03:42 AM
Re: set date variable to 1 hr behind
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1037903
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 03:42 AM
тАО12-18-2006 03:42 AM
Re: set date variable to 1 hr behind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 03:49 AM
тАО12-18-2006 03:49 AM
Re: set date variable to 1 hr behind
The find is an option I did consider.
Peter,
if I change the timezone within the script, doesnt that mean the system time changes even if for a moment?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 03:51 AM
тАО12-18-2006 03:51 AM
Re: set date variable to 1 hr behind
no, as long as you do not export, the variable data stays within the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 04:02 AM
тАО12-18-2006 04:02 AM