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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script to rlogin (rsh) to host of unix servers to find/remove files

Status
Not open for further replies.

arlram

MIS
Jan 13, 2003
8
US
Please help... i need to write a script the uses as input a file with unix host names. The script will rlogin/rsh into each unix host and go to the /var/tmp directory and remove any files over 7 days old.

Please help
 
Try: (untested)

while read hostnam
do
rsh $hostnam find /tmp/var -type f -mtime +7 exec rm {} /;
done < hostnamesfile

HTH Dickie Bird (:)-)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top