On Tue 18 Jul 2006, Marco Gaiarin wrote:
> 
> The script simply run:
> 
>       tmpreaper --ctime --mtime-dir 14d /srv/users/Passaggi/
> 
> but does not work, eg you can see (a limited example on a subdir):
> 
> mouse:/srv/users/Passaggi# stat banca/RETRO.jpg
>   File: `banca/RETRO.jpg'
>   Size: 398741          Blocks: 784        IO Block: 4096   regular file
> Device: 905h/2309d      Inode: 173246610   Links: 1
> Access: (0644/-rw-r--r--)  Uid: (30001/SANVITO\walter)   Gid: 
> (30002/SANVITO\ced)
> Access: 2006-07-17 23:10:43.196063294 +0200
> Modify: 2006-02-27 12:46:06.000000000 +0100
> Change: 2006-03-06 10:40:13.799593529 +0100

(I'm assuming the date then was 18 Jul 2006, date of report.)

Note that the access time is just one day ago (2006-07-17 vs. 2006-07-18).
>From the manpage:

       tmpreaper  dates  files  by  their  atime,  not their mtime, unless you
       select the --mtime option.  If files aren't being removed  when  ls  -l
       implies  they should be, use stat(1) or ls --time=access to examine the
       file's atime and see if that helps to explain the problem.

       Additionally, tmpreaper can be  instructed  to  also  check  the  ctime
       (inode  change  time, which is updated e.g. when the file is created or
       permissions are changed). This is primarily useful  when  tmpreaper  is
       used  to clean up directories that are accessible as a Samba share; DOS
       (and Windows) PCs preserve the mtime and the atime when  copying  to  a
       new  file,  so  that  it  appears  that  the newly created file is old.
       tmpreaper will remove such files is the atime  is  beyond  the  removal
       time,  even though they were just created. This is avoided by using the
       --ctime option.

Hence, using the --ctime option will _prevent_ eary removal; it won't
make tmpreaper remove files _only_ due to their ctime.

Tmpreaper first looks at the atime if --mtime is not given (--ctime
doesn't make any difference here). If the atime is not "old", the file
is skipped. If the atime is _not_ "old", then, if --ctime is given, it
checks to see if the ctime is also "old"; only then is the file removed
(if --ctime is not given, an "old" atime is enough for removal).

If --mtime is given, then only the mtime is used to determine whether
the file should be removed or not. You can't use --mtime together with
--ctime.


I hope this is explanation enough?



Paul Slootman


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to