3 # Run once a week via cron, out of dak's crontab.
7 # ERR traps should be inherited from functions too. (And command
8 # substitutions and subshells and whatnot, but for us the functions is
9 # the important part here)
11 export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars
15 NOW=`date "+%Y.%m.%d-%H:%M:%S"`
16 LOGFILE="$logdir/weekly_${NOW}.log"
17 exec > "$LOGFILE" 2>&1
25 ################################################################################
27 # Purge empty directories
28 echo "Purging empty directories in $ftpdir/pool/"
30 if [ ! -z "$(find $ftpdir/pool/ -type d -empty)" ]; then
31 find $ftpdir/pool/ -type d -empty | xargs rmdir;
35 echo "Splitting queue/done"
36 dak split-done > /dev/null
39 echo "VACUUM; VACUUM ANALYZE;" | psql --no-psqlrc projectb 2>&1
41 # Do git cleanup stuff
42 echo "Doing git stuff"
43 cd /org/ftp.debian.org/git/dak.git
45 git update-server-info
46 # now workaround a git bug not honoring the setup in logs/*
47 # (fix in development, but until it reached backports.org.......)
50 # Clean up apt-ftparchive's databases
52 echo "Cleanup apt-ftparchive's database"
53 apt-ftparchive -q clean apt.conf
54 apt-ftparchive -q clean apt.conf.buildd
56 # Update wanna-build dump
57 echo "Update wanna-build database dump"
58 /org/ftp.debian.org/scripts/nfu/get-w-b-db
60 echo "Fixing symlinks in $ftpdir"
61 symlinks -d -r $ftpdir
63 echo "Finally, all is done, compressing logfile"
69 ################################################################################