GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script help
Operating System - HP-UX
1849069
Members
6753
Online
104041
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
Forums
Discussions
back
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
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
02-23-2004 04:19 PM
02-23-2004 04:19 PM
script help
Hi,
Does anyone have a script which could find missing sequences? Here is our scenariio, we receive files
(eg. FILE_yyyymmddhhmmss_nn_ssss, where nn is a particular node number ie. 34 & ssss is a
sequence number ranging from 0001 - 9999) from an external system which is further processed.
What we need to do is run a script daily to ensure that for each node (nn) all its files/sequences for a
day has been received. The output of the script should write to a file all the missing sequnces per node.
Any ideas on how we could script this check?
Thanks in advance!
Does anyone have a script which could find missing sequences? Here is our scenariio, we receive files
(eg. FILE_yyyymmddhhmmss_nn_ssss, where nn is a particular node number ie. 34 & ssss is a
sequence number ranging from 0001 - 9999) from an external system which is further processed.
What we need to do is run a script daily to ensure that for each node (nn) all its files/sequences for a
day has been received. The output of the script should write to a file all the missing sequnces per node.
Any ideas on how we could script this check?
Thanks in advance!
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 06:12 PM
02-23-2004 06:12 PM
Re: script help
# perl -MFile::Find -le'find(sub{m/FILE_\d{14}_(\d\d)_(\d{4})$/ or return;ref$n{$1}or$n{$1}={n=>$2,x=>$2};$n{$1}{n}>$2 and$n{$1}{n}=$2;$n{$1}{x}<$2 and$n{$1}{x}=$2},".");for(sort{$a<=>$b}keys%n){printf"node %2d %4d .. %4d\n",$_,@{$n{$_}}{"n","x"}}'
Would show the list of nodes with the min and max seq received
# perl -MFile::Find -le'find(sub{m/FILE_\d{14}_(\d\d)_(\d{4})$/ or return;ref$n{$1}{$2}++},".");for(sort{$a<=>$b}keys%n){@x=sort{$a<=>$b}values%{$n{$_}};printf"node %2d %4d .. %4d\n",$_,$x[0],$x[-1]'
should do the same using more memory, but is easier to extend to see if the range is complete
# perl -MFile::Find -le'find(sub{m/FILE_\d{14}_(\d\d)_(\d{4})$/ or return;ref$n{$1}{$2}++},".");for(sort{$a<=>$b}keys%n){@x=sort{$a<=>$b}values%{$n{$_}};evalqq{\@y="$x[0]".."$x[-1]"};printf"node %2d %4d .. %4d %s\n",$_,$x[0],$x[-1],"@x"eq"@y"?"complete":"incomplete"'
All off top of my head. Nothing tested
Enjoy, Have FUN! H.Merijn
Would show the list of nodes with the min and max seq received
# perl -MFile::Find -le'find(sub{m/FILE_\d{14}_(\d\d)_(\d{4})$/ or return;ref$n{$1}{$2}++},".");for(sort{$a<=>$b}keys%n){@x=sort{$a<=>$b}values%{$n{$_}};printf"node %2d %4d .. %4d\n",$_,$x[0],$x[-1]'
should do the same using more memory, but is easier to extend to see if the range is complete
# perl -MFile::Find -le'find(sub{m/FILE_\d{14}_(\d\d)_(\d{4})$/ or return;ref$n{$1}{$2}++},".");for(sort{$a<=>$b}keys%n){@x=sort{$a<=>$b}values%{$n{$_}};evalqq{\@y="$x[0]".."$x[-1]"};printf"node %2d %4d .. %4d %s\n",$_,$x[0],$x[-1],"@x"eq"@y"?"complete":"incomplete"'
All off top of my head. Nothing tested
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2004 06:21 PM
02-23-2004 06:21 PM
Re: script help
Merijn,
If that is off the top of your head, I'm glad it's your head, not mine!!
If that is off the top of your head, I'm glad it's your head, not mine!!
Never preceed any demonstration with anything more predictive than "watch this"
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 2026 Hewlett Packard Enterprise Development LP