- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script using awk
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
09-26-2002 06:40 PM
09-26-2002 06:40 PM
I have a cronjob that run the omnimm command to scan all the media in a our autoloader automatcially.
This is how the output will be generated.
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 09:58:39
STARTING Media Agent "DDS_1"
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 09:58:40
Loading medium from slot 1 to device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 09:59:19
Unloading medium to slot 1 from device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 09:59:40
Loading medium from slot 2 to device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:00:24
Unloading medium to slot 2 from device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:00:45
Loading medium from slot 3 to device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:01:27
Unloading medium to slot 3 from device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:01:49
Loading medium from slot 4 to device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:02:35
Unloading medium to slot 4 from device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:02:56
Loading medium from slot 5 to device /dev/rmt/0m
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:03:39
Unloading medium to slot 5 from device /dev/rmt/0m
[Warning] From: MSM@myserver "DDS_1" Time: 09/27/02 10:04:01
[65:93] Slot 6 configured as cleaning slot ==> skipped.
[Normal] From: MMA@myserver "DDS_1" Time: 09/27/02 10:04:01
COMPLETED Media Agent "DDS_1"
[Normal] From: MSM@myserver "DDS_1" Time: 09/27/02 10:04:01
Slot [side] Medium type Medium Label (ID)
===============================================================================
1 OmniBack II ESC_TRD_ARC_FRI
2 OmniBack II ESC_TBD_ARC_FRI
3 OmniBack II ESC_TRA_ARC_FRI
4 cpio
5 tar
6 Cleaning tape
Final report: 5 media out of 5 successfully scanned.
I only want the following portion.
Slot [side] Medium type Medium Label (ID)
===============================================================================
1 OmniBack II ESC_TRD_ARC_FRI
2 OmniBack II ESC_TBD_ARC_FRI
3 OmniBack II ESC_TRA_ARC_FRI
4 cpio
5 tar
6 Cleaning tape
Final report: 5 media out of 5 successfully scanned.
Although I know that I can use the tail to extract the last ten lines but it doesn't seem to be very robust.
How could I find the pattern "Slot [side]" and print the next 6 lines?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 06:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 06:57 PM
09-26-2002 06:57 PM
Re: script using awk
Oh, you wanted 'awk'. In that case:
# awk '/^Slot/,/^Final/ {print $0}' filename
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 07:27 PM
09-26-2002 07:27 PM
Re: script using awk
Just wondering I have two single slot tape drive
[Normal] From: MSM@server1 "DDS_1_server1" Time: 09/27/02 10:53:57
OmniBack II medium "ESC_TBP_ARC_FRI" found.
[Normal] From: MMA@server1 "DDS_1_server1" Time: 09/27/02 10:52:48
/dev/rmt/0m
Medium verification completed, 0 errors found
[Normal] From: MMA@server1 "DDS_1_server1" Time: 09/27/02 10:52:48
COMPLETED Media Agent "DDS_1_server1"
Final report: 1 media out of 1 successfully scanned.
[Normal] From: MMA@server1 "DDS_2_tpsbwp" Time: 09/27/02 10:52:49
STARTING Media Agent "DDS_2_server1"
[Normal] From: MSM@server1 "DDS_2_server1" Time: 09/27/02 10:53:58
OmniBack II medium "ESC_PBP_ARC_FRI" found.
[Normal] From: MMA@server1 "DDS_2_server1" Time: 09/27/02 10:52:49
/dev/rmt/3m
Medium verification completed, 0 errors found
Is that possible to also extract the output as
DDS_1_server1
OmniBack II medium "ESC_TBP_ARC_FRI" found.
Medium verification completed, 0 errors found
DDS_2_server2
OmniBack II medium "ESC_PBP_ARC_FRI" found.
Medium verification completed, 0 errors found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 07:33 PM
09-26-2002 07:33 PM
Re: script using awk
but I won't be to capture the "Medium verification completed, 0 errors found" message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2002 11:00 PM
09-26-2002 11:00 PM
Re: script using awk
Something like:
awk '/From/{drive=$4}
/OmniBack/{gsub("\"","",drive);print drive;print}
/verification/{print;print ""}' filename
should do it.
Rgds, Robin