Purge based on atime, not mtime (as the touch option in the recycle vfs only change atime, not mtime)

tags/ipasserelle-base-0.2.65-1 0.2.32
Daniel Berteaud 11 years ago
parent 2a9010d193
commit 559c374f3f
  1. 4
      root/etc/cron.daily/purge-homes-recycle

@ -45,8 +45,8 @@ foreach my $user ($a->get_all_by_prop(type=>'user')){
sub remove{
# Remove files with last modification older than $retention
if ( -f ){
my $mtime = stat($_)->mtime;
(time() - $mtime > $retention) && unlink($_);
my $atime = stat($_)->atime;
(time() - $atime > $retention) && unlink($_);
}
# Remove empty directories
elsif ( -d ){

Loading…
Cancel
Save