Fix home RecycleBin purge by using mtime instead of atime

This commit is contained in:
Daniel Berteaud 2015-12-23 11:30:36 +01:00
parent 1fb3be07ab
commit 74846a25bb
1 changed files with 2 additions and 2 deletions

View File

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