HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Rename log file with yesterday date
Operating System - HP-UX
1832490
Members
3573
Online
110043
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
03-12-2007 09:42 PM
03-12-2007 09:42 PM
Rename log file with yesterday date
Hi,
Can you help please.
I want to run a job on daily basis, to rename a log file name with the date of yesterday date?!
Thanks.
Can you help please.
I want to run a job on daily basis, to rename a log file name with the date of yesterday date?!
Thanks.
Set goals, and work to achieve them
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2007 09:59 PM
03-12-2007 09:59 PM
Re: Rename log file with yesterday date
Hi Fuad,
How about using the logrotate tool.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=938732
older versions.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
Regards,
Robert-Jan
How about using the logrotate tool.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=938732
older versions.
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/logrotate-2.5/
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2007 10:07 PM
03-12-2007 10:07 PM
Re: Rename log file with yesterday date
Maybe a little awkward, but how about:
log_suffix=$(perl -MPOSIX=strftime -e 'print strftime("%Y%m%d",localtime(time-86400))')
log_suffix=$(perl -MPOSIX=strftime -e 'print strftime("%Y%m%d",localtime(time-86400))')
Madness, thy name is system administration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2007 10:16 PM
03-12-2007 10:16 PM
Re: Rename log file with yesterday date
Hi,
earlier threads with similar problem:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=139316
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=563529
I would write the filename you want to use tomorrow (i.e. todays date) into a file and then read that file contents tomorrow.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
earlier threads with similar problem:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=139316
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=563529
I would write the filename you want to use tomorrow (i.e. todays date) into a file and then read that file contents tomorrow.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP