Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a vast video folder, sizing about 700GB.

I am having a lot of trouble determining what files have been accessed and if possible I would like to have an option where I can just play videos that I have never listened to before.

I am on Ubuntu Linux, and I was wondering whether there are tools out there that allows me to track that. I don't want to be tied down to a specific player.

share|improve this question
add comment

3 Answers

Use lsof and fuser commands

lsof - gives you which files are open

fuser - gives processes are using which files

Links:

http://www.ibm.com/developerworks/aix/library/au-lsof.html

http://articles.techrepublic.com.com/5100-10878_11-6066842.html

share|improve this answer
add comment

You really would need to use some sort of video player/media library software that can keep track of that information for you. If your FS is tracking access timestamps, you might be able to use those. However, if your file manager does something like read metadata (like codec, height x width, thumbnail) from a video when you open the folder, then atimes aren't going to be of any use either.

The alternative is to have a "new videos" or "unwatched videos" folder for all your new stuff. Don't move it to your main collection until you've watched it at least once.

share|improve this answer
    
One way to keep track of new videos would be to hard or symbolic link them in an unwatched directory. Once you've finished watching them, remove the link. –  Gilles Dec 15 '10 at 22:10
add comment

Traditionally unix systems (including Linux) track the date when a file was last read: its access time, often called atime for short. With these, you can detect that you haven't watched a video because its atime is the same as its mtime (modification time, the time you see in the ls -l output). On the command line, ls -lutr shows files with their access times. There are ways to locate files in a directory according to various time-related criteria, using find or zsh.

Ubuntu nowadays turns off access times, because there's a performance penalty. You can reenable them by editing /etc/fstab and changing the line for a filesystem to include the atime option, as in

/dev/sda1  /  ext4  errors=remount-ro,atime  0  1

(You may see UUID=… in the first column.) This is a per-filesystem setting, you can't enable atimes only for a directory tree (unless you make it a separate filesystem).

You can also access your files through loggedfs Install loggedfs. This is a virtual filesystem that shows a view of the “real“ files underneath, and in addition logs all accesses. The documentation is a little scarce.

share|improve this answer
    
Wouldn't the atimes get updated as soon as, say, a file manager looked at the file to read any metadata about the video or generate a thumbnail? I'd expect that relying on atimes for this kind of thing would be very unreliable. –  afrazier Dec 15 '10 at 22:00
    
@afrazier: The atime is updated as soon as anything reads the file, so if your file manager pulls in video metadata (duration, codec, etc.) or a preview, the atime is updated (if it's enabled). You can avoid this with loggedfs by watching the videos through it but only browsing the underlying filesystem with a thumbnail-showing file manager. Or maybe loggedfs is able to discriminate between file manager access patterns and player access patterns, I don't know it well enough to tell. –  Gilles Dec 15 '10 at 22:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.