From bdfa88a4e3a0fa4221255136b5a2be0e01546a5a Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 27 Sep 2013 12:05:46 +0200 Subject: [PATCH] Convert retention duration in seconds only if purge needs to run (retention not unlimited and Recycle Bin enabled) --- root/etc/cron.daily/purge-homes-recycle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/root/etc/cron.daily/purge-homes-recycle b/root/etc/cron.daily/purge-homes-recycle index a5eb67d..ee6c992 100644 --- a/root/etc/cron.daily/purge-homes-recycle +++ b/root/etc/cron.daily/purge-homes-recycle @@ -30,11 +30,12 @@ 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')); +# Convert retention in seconds +$retention = 60*60*24*$retention; + foreach my $user ($a->get_all_by_prop(type=>'user')){ my $key = $user->key; # Skip the user if RecycleBin doesn't exists