Mailinglist Archive: opensuse (2217 mails)
| < Previous | Next > |
Re: [opensuse] how to know when the last time files have been accessed.
- From: Randall R Schulz <rschulz@xxxxxxxxx>
- Date: Sun, 23 Sep 2007 19:33:54 -0700
- Message-id: <200709231933.54499.rschulz@xxxxxxxxx>
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
> 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
| < Previous | Next > |