Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question for 1-day beginner

Status
Not open for further replies.

Kipnep70

Technical User
Nov 18, 2003
81
US
This is what I got so far:

--------------------------------------------------
BEGIN{
}

/9940B_[0-9]/{
# print $1 " has been mounted for " $2 " minutes.\n"
if(length($2)>=1500)
{
print $1 " ......Cleaning!\n"
print $1 | tpclean ???????
}
}
-----------------------------------------------

I run a script that prints out an output something like this:

Name Mount Time Last Cleaned
-------------------------------------------
9940B_1 1700 No comments
9940B_2 1300
9940B_3 1501
.
.

I want to be able to search for all the drives that have over 1500 hours of mount time and then be able to issue a shell command to clean those drives.. so say 9840B_1 has over 1500 hours of mount time I would then want to issue a shell command similiar to this:

$./tpclean 9840B_1

...and do the same to each drive that has over 1500 hours of mount time.
 
Just a starting point :
/9940B_[0-9]/{
if($2>=1500){
print $1 " ......Cleaning!\n"
system("./tpclean " $1)
}
}

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top