I've many shares on my samba server with recycle bin module activated.

When deleting remote files from Windows I see .Trash directory.

I'd like to automatically remove older files, i.e. 30 days or older.

So I've added something like this to crontab:

00 01 * * * /usr/bin/find /share/share1/.Trash -atime +30 -print -type f -delete

However, if I've a file with last access 2 months ago and I delete it (samba will move that file to recycle bin), my script will delete that file at first run, because the last access was 2 months ago.

  • 1
    -type f should come first. – jordanm Jul 4 '14 at 19:53

from: http://www.samba.org/samba/docs/man/manpages/vfs_recycle.8.html

recycle:touch_mtime = Yes

Specifies whether a file's last modified date should be updated when the file is moved to the repository.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.