HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Shell script - forming tar file name based on grou...
Operating System - HP-UX
1827158
Members
1990
Online
109716
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
04-11-2006 03:51 AM
04-11-2006 03:51 AM
Shell script - forming tar file name based on grouping of specific filenames
Hi,
I have a SHELL script attached in this posting to the filenames and group the files to be tar-ed according to some criteria.
The filename have the following format:
A20060406.0015-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060406.0015-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060307.0017-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060307.0017-0031_SubNetwork=SE,SubNetwork=RNCABC,MeContext=RNCABC_statsfile.xml
The tar filename which contains the grouping of the necessary file has the following naming convention:
A.-__statsfile.GPEH.xml.tar
I need to tar the files according to the following elements from the filename:
start_date: 20060307
start_time: 0017
end_time: 0031
I've managed to form the tar file name based on these 3 elements in order to tar the 4 files mentioned into their specific tar files created.
However, I'd also need to include the element "SubNetwork=SE,SubNetwork=RNCABC,MeContext=RNCABC_statsfile" which is part of the original filename to the tar file name. This element of the filename is known as the Node_Id
To include the element to the tar file name, it has to be based on:
1) if the 3 elements i.e., and are equal for a set of files, then use the Node_Id element of the file having the earliest of the timestamp within this category as one of the GROUPING criterias to bundle the individual files into the specific tar file. The tar file should also contain this particular Node_Id element.
2) if the 3 elements i.e., and are not equal for a set of files, then just use the Node_Id element of the file having the earliest of the timestamp within this category to form the tar file name.
Could anyone help me out with this categorization within the script to include the Node_Id element to the tar file?
Thanks
I have a SHELL script attached in this posting to the filenames and group the files to be tar-ed according to some criteria.
The filename have the following format:
A20060406.0015-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060406.0015-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060307.0017-0031_SubNetwork=SE,SubNetwork=RNC202,MeContext=RNC202_statsfile.xml
A20060307.0017-0031_SubNetwork=SE,SubNetwork=RNCABC,MeContext=RNCABC_statsfile.xml
The tar filename which contains the grouping of the necessary file has the following naming convention:
I need to tar the files according to the following elements from the filename:
start_date: 20060307
start_time: 0017
end_time: 0031
I've managed to form the tar file name based on these 3 elements in order to tar the 4 files mentioned into their specific tar files created.
However, I'd also need to include the element "SubNetwork=SE,SubNetwork=RNCABC,MeContext=RNCABC_statsfile" which is part of the original filename to the tar file name. This element of the filename is known as the Node_Id
To include the
1) if the 3 elements i.e.
2) if the 3 elements i.e.
Could anyone help me out with this categorization within the script to include the Node_Id element to the tar file?
Thanks
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP