Re: script bdf /mount_point with certain percentage usage and then do certain action (225 Views)
Reply
Advisor
zap_2
Posts: 52
Registered: ‎02-20-2005
Message 1 of 4 (225 Views)

script bdf /mount_point with certain percentage usage and then do certain action

Dear All Unix masters,

I have script below:
bdf /u11|awk '{print $5}'|tail -1|cut -c 1-2

How to improve the above script if /u11 reach 75% usage then do the following actions:
a)mailx to certain list mail address
b)move all file in /u11 to the temporary mount point

Please help.Many thanks.
Honored Contributor
likid0
Posts: 981
Registered: ‎03-01-2005
Message 2 of 4 (225 Views)

Re: script bdf /mount_point with certain percentage usage and then do certain action

There is a great script that I have attached that does what your asking for, the author of the script is Bill Hassell, so the points should be for him
Windows?, no thanks
Valued Contributor
Prashantj
Posts: 136
Registered: ‎03-19-2008
Message 3 of 4 (225 Views)

Re: script bdf /mount_point with certain percentage usage and then do certain action

Hi Zap,

Please find attached file contained the require script. Attached script search all mounted file system above 90%.

a) mailx to certain list mail address - included
b) Move all file in /u11 to the temporary mount point - files move as per size, subject or extension. ?

Hope this will help you.
Good judgment comes from experience and experience comes from bad judgment.
Honored Contributor
Hakki Aydin Ucar
Posts: 1,314
Registered: ‎08-16-2006
Message 4 of 4 (225 Views)

Re: script bdf /mount_point with certain percentage usage and then do certain action

I wrote a script as other friends did here, it can meet your requirements, if directory usage reach a defined value it will delete file you stated; before deletion check ,if it is open ,and close it to prevent possible corruption.
It is good for Solaris , but I do think ,,you can easily midfy for HP-UX. and beside do not forget to set ref=75 ..

Regards
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.