was buggy - make more robust
[infrastructure.git] / scripts / nightly-clean-trash.sh
index d4f7614..c740b4f 100755 (executable)
@@ -1,2 +1,5 @@
 #!/bin/bash
-find /build/trash -maxdepth 1 -mtime 1 -print | xargs rm -rf
+# -maxdepth 1 : scans dir and immediate sons
+# -mtime +1 : older than one day
+# grep -v : preserve the top directory
+find /build/trash -maxdepth 1 -mtime +1 -print | grep -v 'trash/*$' | xargs rm -rf