+
+function clean_debbugs () {
+ # Delete files older than 60 days
+ find $queuedir/bts_version_track_archive/ -mtime +60 -type f -delete
+ # Delete empty directories
+ find $queuedir/bts_version_track_archive/ -empty -type d -delete
+}
+
+function reports() {
+ # Send a report on NEW/BYHAND packages
+ log "Nagging ftpteam about NEW/BYHAND packages"
+ dak queue-report | mail -a "X-Debian: DAK" -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org
+ # and one on crufty packages
+ log "Sending information about crufty packages"
+ dak cruft-report > $webdir/cruft-report-daily.txt
+ dak cruft-report -s experimental >> $webdir/cruft-report-daily.txt
+ cat $webdir/cruft-report-daily.txt | mail -a "X-Debian: DAK" -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org -- -F "Debian FTP Masters" -f ftpmaster@ftp-master.debian.org
+}
+
+function pg_timestamp() {
+ tsname=${1:-"unknown"}
+ log "Saving postgres transaction id for ${tsname}"
+ psql -tAc 'select txid_current();' > $base/backup/txid_${tsname}_$(date +%Y.%m.%d-%H:%M:%S)
+}