Add an easy way to got back to the error list
[build-farm.git] / daily.sh
index 1396b83efef490f04b1606c102aa8f0c8617b244..9441b383df01328258c2628a3ed2dcdc25957618 100755 (executable)
--- a/daily.sh
+++ b/daily.sh
@@ -1,17 +1,24 @@
 #!/bin/sh
 
-sqlite3 `dirname $0`/hostdb.sqlite 'VACUUM;'
-cd `dirname $0` && exec ./mail-dead-hosts.pl
+cd $HOME/master || exit 1
+set -x
 
-# delete old ones that are not used any more
-find oldrevs -type f -mtime +4 -links 1 -print0 | xargs -i -0 rm -f \{\}
+(
+date
+set -x
+sqlite3 `dirname $0`/db/hostdb.sqlite 'VACUUM;'
+cd `dirname $0` && ./mail-dead-hosts.py
 
-# delete any really old data
-find . -type f -mtime +120  -print0 | xargs -i -0 rm -f \{\}
+echo "deleting old file that are not used any more"
+find `dirname $0`/data/oldrevs -type f -mtime +10 -links 1 -print0 | xargs -i -0 rm -f \{\}
 
-# delete old cache data
-find ../cache -type f -name "build.*" -mtime +1 -print0 | xargs -i -0 rm -f \{\}
+echo "deleting any really old data"
+find `dirname $0`/data -type f -mtime +120  -print0 | xargs -i -0 rm -f \{\}
 
-# delete partially uploaded files (crashed rsync)
-find . -type f -mtime +2 -name ".build.*" -print0 | xargs -i -0 rm -f \{\}
+echo "delete old cache data"
+find `dirname $0`/cache -type f -name "build.*" -mtime +1 -print0 | xargs -i -0 rm -f \{\}
 
+echo "delete partially uploaded files (crashed rsync)"
+find `dirname $0`/data/upload -type f -mtime +2 -name ".build.*" -print0 | xargs -i -0 rm -f \{\}
+
+) >> daily.log 2>&1