![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tracking down the problem | mattmanuel | UNIX for Advanced & Expert Users | 3 | 11-16-2007 05:51 AM |
| Tracking user | panknil | UNIX for Advanced & Expert Users | 5 | 06-25-2007 08:40 AM |
| tracking user action | xitrum | UNIX for Advanced & Expert Users | 7 | 03-07-2007 12:48 PM |
| Command Tracking | mahatma | UNIX for Advanced & Expert Users | 5 | 04-04-2006 05:30 AM |
| event number tracking | frustrated1 | Shell Programming and Scripting | 4 | 01-09-2006 03:17 AM |
|
|
Submit Tools | LinkBack | Thread Tools | 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? |
| Forum Sponsor | ||
|
|
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |