Re: Tracing file size changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I like "inotify".  I've become somewhat familiar with the interface and I 
believe this will allow you to do what you want.

There are plenty "C" examples out there.

Cheers,

-----Original Message----- 
From: Adam Lee
Sent: Thursday, August 11, 2011 12:17 PM
To: kernelnewbies@xxxxxxxxxxxxxxxxx
Subject: Re: Tracing file size changes

On Wed, Aug 10, 2011 at 07:06:29PM -0400, Chris wrote:
> I'm trying to think of a good way to figure out where space is going on
> somewhat large and busy filesystems.  Often I will be notified by nagios 
> that I
> am running out of space somewhere, and it will even tell me what the trend 
> in
> usage is.  So now I know that I lost a bunch of space recently.
>
> There are several things I can do at that point:
> - Check quota usage.  If quotas are working correctly, this can sometimes
> help when one user is obviously using a ton of space.  More often than 
> not,
> there is nothing obvious, quotas aren't working or the space is used by 
> system
> accounts that provide no help in knowing where the space went.
> - Use du.  This is just plain painful and time consuming.  Doing this 
> usually
> causes too much load.
>
> Without knowing other ways to find information, I was thinking it would be
> really nice to have a way to see which files or directories grew or shrank
> since some point in the past.  Would it be possible to get the kernel to 
> tell
> me when files were opened for writing and closed so I could record the 
> size
> difference?  I know there are various file notify mechanisms, but from 
> what I
> can see, they don't handle millions of files very well.
>
> Of course I'm open to other ideas, but this was my curiosity.
>

Will Inotify help?

http://en.wikipedia.org/wiki/Inotify
http://www.kernel.org/doc/man-pages/online/pages/man7/inotify.7.html

-- 
Regards,
Adam Lee
--------------------------------------------------
E-mail: adam8157@xxxxxxxxx
Website: http://www.adam8157.info
--------------------------------------------------

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies 


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux