Operating System - HP-UX
1748223 Members
4812 Online
108759 Solutions
New Discussion юеВ

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

 
zap_2
Advisor

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.
3 REPLIES 3
likid0
Honored Contributor

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
Prashantj
Valued Contributor

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.
Hakki Aydin Ucar
Honored Contributor

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