was buggy - make more robust
authorthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 21 May 2007 07:59:36 +0000 (07:59 +0000)
committerthierry <thierry@41d37cc5-eb28-0410-a9bf-d37491348ade>
Mon, 21 May 2007 07:59:36 +0000 (07:59 +0000)
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