Web lists-archives.com

Re: [Samba] Samba Recycle Age limit.




Hi,

On 09/04/2017 09:28 AM, sithu via samba wrote:
Please kindly let me know any parameter for recycle bin age limit .

We use this cron script:

#!/usr/bin/perl -w
use strict;
use Getopt::Std;
use File::Find;

@ARGV > 0 and getopts('a:', \my %opt) or die << "USAGE";
Deletes any old files from the directory tree(s) given and
removes empty directories en passant.
usage: $0 [-a maxage] directory [directory ...]
       -a  maximum age in days, default is 7
USAGE

my $max_age_days = $opt{a} || 7;

find({
    wanted => sub { unlink if -f $_ and -M _ > $max_age_days },
    postprocess => sub { rmdir $File::Find::dir },
}, @ARGV);

Perhaps it will help you too.

MJ

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba