Reuse DEADAGE rather than defining our own constant.
[build-farm.git] / daily.sh
index 8bcc03ffad1031318c8030f9a34df3bc08053ae3..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 `dirname $0`/data/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
+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 \{\}
+
+echo "deleting any really old data"
 find `dirname $0`/data -type f -mtime +120  -print0 | xargs -i -0 rm -f \{\}
 
-# delete old cache data
+echo "delete old cache data"
 find `dirname $0`/cache -type f -name "build.*" -mtime +1 -print0 | xargs -i -0 rm -f \{\}
 
-# delete partially uploaded files (crashed rsync)
+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