diff --git a/root/etc/cron.daily/purge-homes-recycle b/root/etc/cron.daily/purge-homes-recycle index fe0c33b..e8e4d6f 100644 --- a/root/etc/cron.daily/purge-homes-recycle +++ b/root/etc/cron.daily/purge-homes-recycle @@ -30,6 +30,8 @@ my $smb = $c->get('smb') || die "Can't find the smb service in the ConfigDB\n"; my $recycle = $smb->prop('RecycleBin') || 'disabled'; our $retention = $smb->prop('RecycleBinRetention') || 'unlimited'; $retention = 'unlimited' unless ($retention =~ m/^\d+$/); +# Convert retention in seconds +$retention = 60*60*24*$retention; exit(0) if (($recycle ne 'enabled') || ($retention eq 'unlimited')); @@ -37,8 +39,6 @@ foreach my $user ($a->get_all_by_prop(type=>'user')){ my $key = $user->key; # Skip the user if RecycleBin doesn't exists next unless (-d "/home/e-smith/files/users/$key/home/Recycle Bin"); - # Convert retention in seconds - $retention = 60*60*24*$retention; finddepth(\&remove, "/home/e-smith/files/users/$key/home/Recycle Bin/"); }