HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the files increasing in drive

 
trilok_pvp
Frequent Advisor

How to check the files increasing in drive

Hi

In HP unix server, the drive disk01 keep on increasing nearly 2 GB daily, Now its reached 91 %. How to check which directory files are creating up to date.
12 REPLIES
Pete Randall
Outstanding Contributor

Re: How to check the files increasing in drive

You can run "du -sk" on the mount point to give you a first level overview - maybe put this in cron and save the outputs for a few days to give you a feel for where the growth is occurring.


Pete

Pete
Johnson Punniyalingam
Honored Contributor

Re: How to check the files increasing in drive

>>>>>>In HP unix server, the drive disk01 keep on increasing nearly 2 GB daily, Now its reached 91 %. How to check which directory files are creating up to date.<<<<<<<<<<<

Example :-

cd /disk01
du -sk *

(look for directory /files has biggersize)

or

find /disk01 -xdev -type f -size +5000000c -exec ll {} \; | sort -nk 5

HTH,

Johnson
Problems are common to all, but attitude makes the difference
trilok_pvp
Frequent Advisor

Re: How to check the files increasing in drive

Hi i tried with du -sk, but it gets hangs.

obelix:/>du -sk

Many folders and subfolders are in disk01, i need to check which folder files are creating.
Pete Randall
Outstanding Contributor

Re: How to check the files increasing in drive

It may well take a while. The du command has to search through all the files, adding up the sizes to give you a summary. Be patient.


Pete

Pete
Johnson Punniyalingam
Honored Contributor

Re: How to check the files increasing in drive

>>Hi i tried with du -sk, but it gets hangs<<<

Above input by you, looks like you may disk problem ?

bdf
dmesg
check /var/adm/syslog/syslog.log


cd /disk01

find . -mtime -1 -exec ll -t {} \;

find . -mtime 0 -size +500 -exec ll -t {} \; |more
Problems are common to all, but attitude makes the difference
trilok_pvp
Frequent Advisor

Re: How to check the files increasing in drive

Hi

when using du -sk, it is showing the used space of disk01, i need to check the files which are recently updated in a directory in disk01
Johnson Punniyalingam
Honored Contributor

Re: How to check the files increasing in drive

>>when using du -sk, it is showing the used space of disk01, i need to check the files which are recently updated in a directory in disk01<<

why are you doing # du -sk /disk01 ?

you should

cd /disk01
du -sk *
Problems are common to all, but attitude makes the difference
trilok_pvp
Frequent Advisor

Re: How to check the files increasing in drive

Hi

i Need to check Latest Files generating in MOUNT point disk01
Johnson Punniyalingam
Honored Contributor

Re: How to check the files increasing in drive

>>i Need to check Latest Files generating in MOUNT point disk01<<<


Any helps from the above commands earlier post

cd /disk01

find . -mtime -1 -exec ll -t {} \;

find . -mtime 0 -size +500 -exec ll -t {} \; |more

or

>>Latest Files generating<<<<<

cd /disk01
ls -lrt
Problems are common to all, but attitude makes the difference
Pete Randall
Outstanding Contributor

Re: How to check the files increasing in drive

Define "latest files generating". Do you mean in the last day, hour, minute, or some other time frame?

In this sort of case, you would use the find command, as Johnson pointed out, with the mtime parameter. However, the mtime parameter only granularizes down to the day so, if you want to narrow your search further you will have to use the "-newer" option to compare to a reference file. First use the "touch" command to create your reference file with a time stamp of an hour ago, then run the find command:

find /disk01/* -newer my_reference_file


Pete

Pete
Bill Hassell
Honored Contributor

Re: How to check the files increasing in drive

du -sk is not the best command to use. It only shows the first level directories. Use this command instead:

du -kx /disk01 | sort -rn | head -20

This will show the top 20 directories (change head -20 to see more) sorted largest to smallest. Remember, you are not looking for the biggest files! You are looking for the biggest directories, specifically the directories that are growing. Once these are identified, you can determine what is the purpose of the files in that directory. Sort the files in that directory by size like this:

ls -la /disk01/someDirectory | sort -rnk5

Then sort the files by the last modification (change) time:

ls -lart /disk01/someDirectory

The newest files will be at the bottom of the list.


Bill Hassell, sysadmin
Suraj K Sankari
Honored Contributor

Re: How to check the files increasing in drive

Hi,

Best option is find command search for size dont put any other thing like "-exec ls -l {} \; "
just give simple find command after 10 min run again the same and compair the both output you came to know the file.

find /disk01 -size +100000 -print

Suraj