Re: [opensuse] how to know when the last time files have been accessed.



On Sunday 23 September 2007 19:22, Arie Reynaldi Z wrote:
Hi All,

I have samba file server that uses as file-sharing (mostly mp3).
Right now I want to know which file (mp3) that have been accessed
(read), not changed.. So I can delete all music files that stay too
long but not played for a long time.. How can I do it ?
I try 'ls -lat' .. buat I guess it said which file that have been
changed / writed /edited. right ?

Each file in a Unix / Linux file system records three time-stamps for
each file it holds:

- Modify time
The most recent time the file's contents were changed

- Read time
The most recent time the file's contents were read

- Change time
The most recent time the file's metadata was changed; This includes
the file's owner, group, permissions (mode) _and_ its modify and read
times.


Each of these times is accessible via the stat family of system calls
and through various command-line tools, such as ls, find and getfattr,
among others.

If you're goal is to enumerate files that have been read within some
time range, the "find" command is probably the best tool. Read the
manual page to find out how to select files based on their access
times.

Note, too, that any command that reads a file (cp, less, file, zip, tar
and many, many others) will alter the access time. Even backup software
(poorly written backup software!) can alter the access time of files it
saves.


regards,

--
Arie Reynaldi Zanahar


Randall Schulz
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: Some thoughts for the future
    ... I mean that fedora rocks! ... I see the mp3 part now... ... programs installations, user common needs all can be recorded in the user db ... what you doing and make a command for it.... ...
    (Fedora)
  • Re: How to convert MP3 to WMA v7 (_not_ WMA v9) audio files ?
    ... Marco Zara [MVP - Digital Media] schrieb: ... MP3 files are recognized by the Windows Media Player 7 and by the GUI ... But it is DEFINITELY NOT SUPPORTED by the command line tool! ... There is also an error message which could be found inside the file (but ...
    (microsoft.public.windowsmedia.encoder)
  • Re: Script to sort file by access time
    ... the problem is when I'm doing ls -ltu or stat command the access time ... is modified at the time the command is done. ... Is it possible to have access to tha access time information of a file ... Executing the script will indeed update ...
    (comp.unix.shell)
  • Re: Script to sort file by access time
    ... the problem is when I'm doing ls -ltu or stat command the access time ... is modified at the time the command is done. ... Is it possible to have access to tha access time information of a file ... Executing the script will indeed update ...
    (comp.unix.shell)
  • Re: Script to sort file by access time
    ... the problem is when I'm doing ls -ltu or stat command the access time ... is modified at the time the command is done. ... Is it possible to have access to tha access time information of a file ... Executing the script will indeed update ...
    (comp.unix.shell)