Thanks for the answer. The problem that this way is pretty much the same as my find. I want you to be able to delete the file based on the date they were sent to the bin. As I gave in the example: The file has not been changed since 2015, when it is deleted now in 2017, it goes to the bin, dated 2015, when the find pass will erase, why it does not validate when it has been deleted, but the file information. Regards; Em 25-04-2017 10:20, Dario Lesca via samba escreveu:> Il giorno mar, 25/04/2017 alle 09.25 -0300, Carlos A. P. Cunha via > samba ha scritto: >> Hello >> My fileserver is a samba 4.5.4, in Ubuntu 14.04, is all ok. >> My question is, >> >> Have the recycle bin enabled, and would like a way to rotate the >> files, >> already have something today that is via find >> >> >> Find /mnt/samba -depth -mtime +30 -print -delete >> >> >> This works however, it will delete the files inside the destination >> with >> more than 30 days, but this more than 30 days is not when it went to >> the >> bin but the date of the file, which does not change when it is >> deleted . >> >> Examples: >> >> File with date of 2015, was deleted now in 2017, when run the find >> it >> will erase this file, even if it was deleted on the same day. >> >> >> What I would like is to see an alternative to find or when it goes >> to >> the bin it is changed (date) to find it to be correct. >> >> Any idea ? > > This is what I do for clear my trash: > > # echo '/usr/sbin/tmpwatch --dirmtime --atime --force $[24*30] /u/samba/cestino/' > /etc/cron.daily/cestino > # chmod 755 /etc/cron.daily/cestino > > The tricks is '--atime', then if you want still use your command with > find, you can try '-atime' find option. > > Hope this help > > Thanks >
Il giorno mar, 25/04/2017 alle 10.30 -0300, Carlos A. P. Cunha ha scritto:> Thanks > for the answer. > > The problem that this way is pretty much the same as my > find. > > I want you to be able to delete the file based on the date > they were sent to the bin. As I gave in the > example: > > > > The file has not been changed since 2015, when it is > deleted now in 2017, it goes to the bin, dated 2015, when > the > find pass will erase, why it does not validate when it has > been deleted, but the file information.You are right! The option '-atime' use the access time, but the access time not change when the file is delete from the share and samba move it from original dir to trash. It would be useful if samba update the atime when a file was deleted. Then I do not know how to do what you want, without a specific shell script which verifies whenever what files were added into trash from the previous time, touch the atime to this new trash files and then apply your or my delete procedure If you find a better solution let me know. Thanks -- Dario Lesca (inviato dal mio Linux Fedora 25 Workstation)
On Tue, Apr 25, 2017 at 6:30 AM, Carlos A. P. Cunha via samba < samba at lists.samba.org> wrote:> The file has not been changed since 2015, when it is deleted now in 2017, > it goes to the bin, dated 2015, when the find pass will erase, why it does > not validate when it has been deleted, but the file information.Add the following line in your smb.conf recycle:touch = true That will update the atime when the file is put in the recycle bin. For more, see man vfs_recycle
Il giorno ven, 28/04/2017 alle 10.21 -0700, Mark Nienberg via samba ha scritto:> Add the following line in your smb.conf > > recycle:touch = true > > That will update the atime when the file is put in the recycle bin.This flag is on for me. That's why it works for me tmpwatch --atime option:> /usr/sbin/tmpwatch --dirmtime --atime --force $[24*30] /u/samba/cestino/Tanks -- Dario Lesca (inviato dal mio Linux Fedora 25 Workstation)