Re: [opensuse] how to know when the last time files have been accessed.
- From: joe <joe@xxxxxxxxxx>
- Date: Sun, 23 Sep 2007 19:30:08 -0700
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 ?
First make certain that atime is enabled on the filesystem of interest. Then
it's easy to test for last access time with a shell script, and delete those
files which haven't been accessed for whatever time period you decide.
Off the top of my head, you could have a cron job do something like:
find /path/to/mp3s -atime +90 -exec rm {} \;
every day at 0420 or something appropriate.
Joe
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx
- References:
- [opensuse] how to know when the last time files have been accessed.
- From: Arie Reynaldi Z
- [opensuse] how to know when the last time files have been accessed.
- Prev by Date: [opensuse] how to know when the last time files have been accessed.
- Next by Date: Re: [opensuse] how to know when the last time files have been accessed.
- Previous by thread: [opensuse] how to know when the last time files have been accessed.
- Next by thread: Re: [opensuse] how to know when the last time files have been accessed.
- Index(es):