![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tracking down the problem | mattmanuel | UNIX for Advanced & Expert Users | 3 | 11-16-2007 09:51 AM |
| Tracking user | panknil | UNIX for Advanced & Expert Users | 5 | 06-25-2007 12:40 PM |
| tracking user action | xitrum | UNIX for Advanced & Expert Users | 7 | 03-07-2007 04:48 PM |
| Command Tracking | mahatma | UNIX for Advanced & Expert Users | 5 | 04-04-2006 09:30 AM |
| event number tracking | frustrated1 | Shell Programming and Scripting | 4 | 01-09-2006 07:17 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
tracking sequence num
I have files coming to an input directory every few mins...eg
test_00012.txt test_00013.txt test_00014.txt I need to write a script to monitor these and if a file is missing from the sequence I need my script to spot this so I can alert someone... ie... if I got the following: test_00012.txt test_00014.txt test_00015.txt I am missing the file with seq num... how do I spot this in a script so I can alert it? |
|
||||
|
Hi ,
one suggestion, cut the sequence numbers from the first and last file names after sorting file names, somthing like this 1) ls -lrt *test*|sort (seq no.)| cut the seq no. of first and last using head and tail. 2) get number of files by subtracting last and first no. 3) get the no of files using ls -lrt *test* |wc -l 4) compare the result in step 2 and 3. 5) If they are same everything is fine otherwise somthing is missing Gaurav |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|