Samba Recycle Age limit.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Samba Recycle Age limit.

Samba - General mailing list
Dear ,

My current samba versiion is samba-4.4.4 and running on centos 7.2

My current samba have recycle enable .

I want to age limit for recycle bin .

Please kindly let me know any parameter for recycle bin age limit .

Best Regards,
Si Thu.
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
On Mon, 4 Sep 2017 13:58:52 +0630
sithu via samba <[hidden email]> wrote:

> Dear ,
>
> My current samba versiion is samba-4.4.4 and running on centos 7.2
>
> My current samba have recycle enable .
>
> I want to age limit for recycle bin .
>
> Please kindly let me know any parameter for recycle bin age limit .
>
> Best Regards,
> Si Thu.

As far as I am aware, there isn't one. You will need to write a cron
script to delete anything over the age limit.

Rowland
 

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
In reply to this post by Samba - General mailing list
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
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
In reply to this post by Samba - General mailing list
For me, is "magic line"


find $DEST -depth -mtime +$DAYS -print -delete

$DEST = Files
+$DAYS = Days is retention

Regards,

Em 04-09-2017 04:28, sithu via samba escreveu:

> Dear ,
>
> My current samba versiion is samba-4.4.4 and running on centos 7.2
>
> My current samba have recycle enable .
>
> I want to age limit for recycle bin .
>
> Please kindly let me know any parameter for recycle bin age limit .
>
> Best Regards,
> Si Thu.


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
Carlos A. P. Cunha via samba wrote:
> For me, is "magic line"
>
> find $DEST -depth -mtime +$DAYS -print -delete
----
    I'm guessing you probably want 'ctime' there.

    If you use mtime, then it will be deleted "ndays" after
the last modification date on the file -- NOT the time the file
was moved into the recycle bin.

    If you use ctime - that appears to update when the file
is moved into a different directory (the recycle bin) -- allowing
things to expire some number of days after it is "recycled".


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
No, is correct "mtime", but forget information add two line in smb,conf.....

recycle:touch = yes
recycle:touch_mtime = yes

:-D

Em 07-09-2017 15:17, L A Walsh escreveu:

> Carlos A. P. Cunha via samba wrote:
>> For me, is "magic line"
>>
>> find $DEST -depth -mtime +$DAYS -print -delete
> ----
>    I'm guessing you probably want 'ctime' there.
>
>    If you use mtime, then it will be deleted "ndays" after
> the last modification date on the file -- NOT the time the file
> was moved into the recycle bin.
>
>    If you use ctime - that appears to update when the file
> is moved into a different directory (the recycle bin) -- allowing
> things to expire some number of days after it is "recycled".
>


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba
Reply | Threaded
Open this post in threaded view
|

Re: Samba Recycle Age limit.

Samba - General mailing list
Clever, however, that modifies the metadata of the user's
file.  If the user restores the file from the recycle-bin, it seems
the file's original modify time would not be restored (or it's
handled by another setting I don't know about.. :-)   ).

If the original modify time isn't restored, and the modify time was
used by something like 'make' to determine whether or not to
rebuild something, the user might get an unanticipated rebuild
next time they did a make.

Probably not a problem, but if one was paranoid one might wonder
about unforeseen consequences...  (just because you are paranoid
doesn't mean they are not "out to get you"...)

 :-)


Carlos A. P. Cunha wrote:

> No, is correct "mtime", but forget information add two line in
> smb,conf.....
>
> recycle:touch = yes
> recycle:touch_mtime = yes
>
> :-D
>
> Em 07-09-2017 15:17, L A Walsh escreveu:
>> Carlos A. P. Cunha via samba wrote:
>>> find $DEST -depth -mtime +$DAYS -print -delete
>> ----
>>    ...[ctime vs. mtime comparison]...
>


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