14383 shaares
5331 private links
5331 private links
#!/bin/sh
find /mnt/tank0/.recycle/* -atime +14 -exec rm -rf '{}' \;
find /mnt/tank0/.recycle/ -depth -type d -empty -exec rmdir {} \;
Update 2011/03/04: Updated the script to delete empty directories by adding:
find /mnt/DATA/.recycle/ -depth -type d -empty -exec rmdir {} \;
which was suggested by Alan in the comments below. Thanks Alan for the updated script!