From: Roel van Meer on
Leonardo Carneiro - Veltrac writes:

> There is a way to make files being automatically deleted some time after
> they have been created?

Yes, the tmpwatch utility can do this, but it is not part of the samba
suite. It is probably already part of your distribution, but if not, you
can get it from https://fedorahosted.org/tmpwatch/

Regards,

roel

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Leonardo Carneiro - Veltrac on
Hi Brian, tks for your answer. I'm confident that my goal could be
achieved through the use of some third-party tool, like a script or
something like it, like you sugested. But what i really need to know is
if there is some feature in samba that would allow me to do just that.

But tks anyway for your answer.


On 06/29/2010 11:49 AM, Brian Cuttler wrote:
> You could write something to check file create times and
> delete files older than 36 hours, and run if from cron
> several times per day.
>
> I'd suggest # find, but it doesn't have the granularity
> you are looking for, you could run it at 00:01 and remove
> files there where 2 days old.
>
> I did somethign similar on a VMS system I was managing, worked
> well until some enterprising student found (I don't believe
> they wrote it themselves) a program to reset the time stamp
> on their files (which your users may start doing as well, perhaps
> using # touch). At which point I started looking for files with
> creation dates in the future... many users of the date reset
> program wheren't quite as smart as they thought they where.
>
>
>
>
> On Tue, Jun 29, 2010 at 11:32:52AM -0300, Leonardo Carneiro - Veltrac wrote:
>
>> Hi everyone,
>>
>> There is a way to make files being automatically deleted some time after
>> they have been created?
>> I know that, with some scripting wizardry i could achieve this, but i
>> wanna know if samba has this kind of feature.
>>
>> I have a temp folder that users insist in use like a backup folder, so i
>> want to files to be deleted 24 hours after they have been created.
>>
>> I cannot just delete everything at midnight because this folder is used
>> in full time, so if a user create a file at 23h59, it would be deleted a
>> minute later.
>>
>> Sorry for my poor english and tks in advance.
>> --
>> Leonardo Carneiro
>> --
>>
> ---
> Brian R Cuttler brian.cuttler(a)wadsworth.org
> Computer Systems Support (v) 518 486-1697
> Wadsworth Center (f) 518 473-6384
> NYS Department of Health Help Desk 518 473-077
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Brian Cuttler on

You could write something to check file create times and
delete files older than 36 hours, and run if from cron
several times per day.

I'd suggest # find, but it doesn't have the granularity
you are looking for, you could run it at 00:01 and remove
files there where 2 days old.

I did somethign similar on a VMS system I was managing, worked
well until some enterprising student found (I don't believe
they wrote it themselves) a program to reset the time stamp
on their files (which your users may start doing as well, perhaps
using # touch). At which point I started looking for files with
creation dates in the future... many users of the date reset
program wheren't quite as smart as they thought they where.




On Tue, Jun 29, 2010 at 11:32:52AM -0300, Leonardo Carneiro - Veltrac wrote:
> Hi everyone,
>
> There is a way to make files being automatically deleted some time after
> they have been created?
> I know that, with some scripting wizardry i could achieve this, but i
> wanna know if samba has this kind of feature.
>
> I have a temp folder that users insist in use like a backup folder, so i
> want to files to be deleted 24 hours after they have been created.
>
> I cannot just delete everything at midnight because this folder is used
> in full time, so if a user create a file at 23h59, it would be deleted a
> minute later.
>
> Sorry for my poor english and tks in advance.
> --
> Leonardo Carneiro
> --
> To unsubscribe from this list go to the following URL and read the
> instructions: https://lists.samba.org/mailman/options/samba
---
Brian R Cuttler brian.cuttler(a)wadsworth.org
Computer Systems Support (v) 518 486-1697
Wadsworth Center (f) 518 473-6384
NYS Department of Health Help Desk 518 473-0773



IMPORTANT NOTICE: This e-mail and any attachments may contain
confidential or sensitive information which is, or may be, legally
privileged or otherwise protected by law from further disclosure. It
is intended only for the addressee. If you received this in error or
from someone who was not authorized to send it to you, please do not
distribute, copy or use it or any attachments. Please notify the
sender immediately by reply e-mail and delete this from your
system. Thank you for your cooperation.


--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Mike Eggleston on
On Tue, 29 Jun 2010, Brian Cuttler might have said:

>
> You could write something to check file create times and
> delete files older than 36 hours, and run if from cron
> several times per day.
>
> I'd suggest # find, but it doesn't have the granularity
> you are looking for, you could run it at 00:01 and remove
> files there where 2 days old.
>
> I did somethign similar on a VMS system I was managing, worked
> well until some enterprising student found (I don't believe
> they wrote it themselves) a program to reset the time stamp
> on their files (which your users may start doing as well, perhaps
> using # touch). At which point I started looking for files with
> creation dates in the future... many users of the date reset
> program wheren't quite as smart as they thought they where.

(not tested and for GNU/linux)

#!/bin/sh

# $Id$
# $Log$

# delete files older than yesterday

# globals
dir=/tmp
tf=$dir/.$$

# create a temporary file
touch -d yesterday $tf

# find all older files
find $dir ! -newer $tf -print > $tf

# delete older files
xargs rm -rf < $tf

# clean up
rm -f $tf
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
From: Benedict White on
You could write a bash script like this:

#!/bin/bash
find /some/temp/dir/ -name "*" -atime 1 -delete

Where atime* indictates file was modified 1 * 24 hours ago.

(*There are loads of time based operators for find)

See http://unixhelp.ed.ac.uk/CGI/man-cgi?find for the find man page.

You may also want to use -P to never follow symbolic links.

Then once the batch file is created, chmod it to something like 750, and make it a cron job to run every hour.

Kind Regards,
Benedict White

Tel:
01444 238070
Tech:
01444 238080
Fax:
01444 238099
Web:
http://www.cse-ltd.co.uk
Registered in England and Wales No: 3066242
27 Victoria Gardens, Burgess Hill, West Sussex, RH15 9NB



Legal Disclaimer: This message and any attachment may be confidential and privileged. If you are not the intended recipient please notify the sender and delete this e-mail and any attachment from your system. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. All information given in this e-mail is provided in good faith but not binding for legal reasons.



-----Original Message-----
From: samba-bounces(a)lists.samba.org [mailto:samba-bounces(a)lists.samba.org] On Behalf Of Leonardo Carneiro - Veltrac
Sent: 29 June 2010 15:33
To: samba(a)lists.samba.org
Subject: [Samba] file "time-to-live"

Hi everyone,

There is a way to make files being automatically deleted some time after
they have been created?
I know that, with some scripting wizardry i could achieve this, but i
wanna know if samba has this kind of feature.

I have a temp folder that users insist in use like a backup folder, so i
want to files to be deleted 24 hours after they have been created.

I cannot just delete everything at midnight because this folder is used
in full time, so if a user create a file at 23h59, it would be deleted a
minute later.

Sorry for my poor english and tks in advance.
--
Leonardo Carneiro
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba