Fix home RecycleBin purge by using mtime instead of atime

tags/ipasserelle-base-0.2.65-1 0.2.54_el6
Daniel Berteaud 9 years ago
parent 1fb3be07ab
commit 74846a25bb
  1. 4
      root/etc/cron.daily/purge-homes-recycle

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

Loading…
Cancel
Save