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!

How can I isolate old filesystems? 1

Status
Not open for further replies.

ckerner

MIS
Jul 12, 2001
1
US
Hello, I'm a mainframe systems guy who installed linux for s/390 so my director has me helping out our hp-ux staff now part-time. I need to be able to isolate file systems that have not been accessed in 90 days. I didn't know if anyone had any thoughts on this. One thought I had was to take the 'bdf -l' output to get the local mounted filesystems and then try and use the find command to parse the filesystems. Is anyone doing anything like this to find old filesystems, or any thoughts on where to start?

Thanks in advance,
Chad
 
Hi
What do you mean isolate. You want to disable it. or you just want to recognize it that it is not been accessed from 90 days.
ls -lau filename(u = touch files by date)
then you can compare the timestamp with current time. if it is more then 90days that file is not even looked. if all files on that file system are that way you can isolate that file system.

Sachin
 
Hello:
I have an idea but perhaps is a bit strange. If you want to know if some file system isn´t accesed in more than 90 days you can use the properties of the automountd daemon. First you can mount by NFS all the file systems under suspicius and then set the automunt daemon to umount the file system in 90 days. The file systems mounted at the end of the 90 days have been accessed and the other don´t. I hope this help.
man automount
 
I guess that you need a script like this, you could add a further line to unmount the fs if really neccessary, although I probably wouldn't advise

#!/usr/bin/ksh
#This script will test each filesystem to check whether any files have been accessed # in the last 90 days
#
REPORT=/home/fiction1
echo "Testing filesystems for access times\n" > $REPORT
for i in /tmp /home
do
var1=`find $i -depth -atime 90 -mountstop | wc -l`
if [ $var1 -eq 0 ]
then
echo "The Filesystem $i has not been accessed in the last 90 days\n" >> $
REPORT
else
echo "The Filesystem $i has been accessed in the last 90 days" >> $REPORT
echo "There are $var1 accessed files in the $i directory" >> $REPORT
fi
done

Cheers
Queenie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top