[Samba] file "time-to-live"
Benedict.White at cse-ltd.co.uk
Tue Jun 29 09:18:06 MDT 2010
You could write a bash script like this:
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.
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.
From: samba-bounces at lists.samba.org [mailto:samba-bounces at lists.samba.org] On Behalf Of Leonardo Carneiro - Veltrac
Sent: 29 June 2010 15:33
To: samba at lists.samba.org
Subject: [Samba] file "time-to-live"
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
Sorry for my poor english and tks in advance.
To unsubscribe from this list go to the following URL and read the
More information about the samba