- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- file limit
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 11:22 AM
07-11-2005 11:22 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:16 PM
07-11-2005 12:16 PM
Solution--
du -sk /tmp/* | sort -rn | head |mailx -s "top list" myeamil@address.com
--
the next phase you can use more tools like awk, etc.. to set a threshold and then only email yourself those files that are above a certain size length in Kb.
I'm sure the guys here will supply you with some tools..
good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:22 PM
07-11-2005 12:22 PM
Re: file limit
but if I only want to gzip the files that over 10M size , what can I do ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:33 PM
07-11-2005 12:33 PM
Re: file limit
I am new to shell prg but try the one below
for i in `ls -lrt|egrep 'file1|file2'|awk '{print $5,$9}'|tr -s " "|sed s/" "/"#"/g`
do
if [ `echo $i|cut -f1 -d "#"` -gt 100000000000 ]
then
j=`echo $i|cut -f2 -d "#"`
echo "$j is greater than 10GB"
echo "Compressing the fiel $j
gzip $j
fi
done
replace file1 and file2 with the names of your files
Put the script in cron and redirect the output of this script to mailx and receive the mail
Verify the number of zeros in if loop also. bytes to GB conversion!!!!!
Regards
CS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:35 PM
07-11-2005 12:35 PM
Re: file limit
sorry i made it to 10Gb reduce 3 zeros in the if loop to make it to 10MB
regrdas
CS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:39 PM
07-11-2005 12:39 PM
Re: file limit
if the file is not being used, then you can do what you want to (gzip, whatever).
get yourself a really good tool called: LSOF
and figure if any process is using these big files in /tmp. If not, then do a gzip and move them out of /tmp into say: /usr/tmp or something else.
you can also use this simple option to ls:
ls -u /tmp/bigfile
if the file ACCESS time is old, then you might gzip.
I would hate to see you break something by trying to rename the file that is being written to or read from.. pls use caution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 12:59 PM
07-11-2005 12:59 PM
Re: file limit
I tried saju's script , but it seems too complicate for me , could suggest more simpler script ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 01:03 PM
07-11-2005 01:03 PM
Re: file limit
i think u should look at the points u have assigned. 0 out of 30 (and counting) is not good.
http://forums2.itrc.hp.com/service/forums/pageList.do?userId=CA1293896&listType=unassigned&forumId=1
show your appreciation to those who have assisted u in finding your answers.
regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 01:08 PM
07-11-2005 01:08 PM
Re: file limit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2005 04:11 PM
07-11-2005 04:11 PM
Re: file limit
I tried saju 's method but it seems don't have any output , and it is quite complicate for me so I don't know how to make it work , is there other simpler method can do that ? thx