LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2007, 06:23 AM   #1
f97mp
LQ Newbie
 
Registered: Feb 2007
Distribution: Debian GNU/Linux
Posts: 4

Rep: Reputation: 0
Collecting file modification statistics


I wonder if there is a program (e.g. in the shell) for collecting statistics regarding how often files are written to? Basically I would like to compile a list of the files most often modified on my computer during some period of time. I know one could in some way "manually" use the mtime of the files, but I'd prefer an already existing solution if such exists.

I'm intending to set up a Linux system run entirely from a USB flash memory and I would like to know which part of the file system to put on a jffs2 partition, i.e. the most frequently modified files, hence my question above.

Thank you.
 
Old 02-06-2007, 07:47 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you would like a fine-grained view of that you would (AFAIK) have to intercept syscalls like write. Else maybe use some form of SAR or lsof (select by fd, write access). Guesstimating and depending on usage I'd say ordered top four: /var (logs), /tempdirs (obvious), /home and /etc (sporadically).
 
Old 02-06-2007, 10:03 AM   #3
f97mp
LQ Newbie
 
Registered: Feb 2007
Distribution: Debian GNU/Linux
Posts: 4

Original Poster
Rep: Reputation: 0
Thank you for your reply unSpawn. Unfortunately I cannot see exactly how to use these tool in order to accomplish what I intended in a straight forward way (tried atsar and lsof).

Thanks for your "guesstimations" regarding disk usage.
 
Old 02-06-2007, 12:10 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Atsar would be kind of coarse since it only measures writes per partition so you would have to have a per root dir partition setup. Not impossible but also not the easiest thing to wedge in later on ;-p Lsof only produces one time results so you would have to run a periodical script that parses lsof output, checks which files are open for writing and check process age wrt longevity. The script itself isn't that hard to produce, but I wonder if Real Life fine-grained results would matter wrt the guesstimate. If due to usage you can for instance predict a lot of short-lived temp-writing processes, putting tempdirs on a small tmpfs could be beneficial wrt speed and wear n tear.
 
Old 02-06-2007, 12:18 PM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
A lot of embeded systems don't have a /var for this reason.
Depends on what you want to do.. it has its pros and cons.
Or they are in ram.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving file size, or its modification time _cih_ Linux - Newbie 3 12-19-2006 05:48 AM
Track File modification dhammika Programming 1 11-25-2005 06:03 AM
time stamp for file modification youngstorm Linux - Newbie 2 11-01-2005 03:46 PM
file modification in linux nov Linux - Newbie 3 06-05-2005 09:02 AM
File Modification Date Comparison MadTurki Programming 7 03-08-2004 04:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration