3 # Executed daily via cron, out of dak's crontab.
6 export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars
9 ################################################################################
11 echo Archive maintenance started at $(date +%X)
14 NOTICE="$ftpdir/Archive_Maintenance_In_Progress"
15 LOCKCU="$lockdir/daily.lock"
16 LOCKAC="$lockdir/unchecked.lock"
22 if [ "$lockac" -eq "1" ]; then
26 lockfile -l 3600 $LOCKCU
31 Packages are currently being installed and indices rebuilt.
32 Maintenance is automatic, starting at 13:52 US Central time, and
33 ending at about 15:30. This file is then removed.
35 You should not mirror the archive during this period.
38 ################################################################################
40 echo "Creating pre-daily-cron-job backup of projectb database..."
41 pg_dump projectb > $base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
43 ################################################################################
45 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
47 $scriptsdir/update-bugdoctxt
48 $scriptsdir/update-mirrorlists
49 $scriptsdir/update-mailingliststxt
51 ################################################################################
53 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
56 dak process-new -a -C COMMENTS >> REPORT
59 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
60 cd $queuedir/o-p-u-new
62 dak process-new -a -C COMMENTS >> REPORT
65 ################################################################################
67 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
72 dak process-accepted -pa *.changes | tee REPORT | \
73 mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
77 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
83 symlinks -d -r $ftpdir
85 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
87 dak make-suite-file-list
89 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
92 dak import-keyring -L /srv/keyring.debian.org/keyrings/debian-keyring.gpg
94 # Generate override files
98 # Update task overrides for testing and unstable
99 # [JT 2004-02-04 disabled; copying in by hand for now]
100 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
101 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
104 rm -f override.sid.all3
105 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
107 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
109 # Generate Packages and Sources files
111 apt-ftparchive generate apt.conf
112 # Generate *.diff/ incremental updates
113 dak generate-index-diffs
114 # Generate Release files
115 dak generate-releases
117 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
119 # Clean out old packages
123 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
125 # Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
126 # update this before wanna-build is updated.
127 psql projectb -A -t -q -c "SELECT filename FROM queue_build WHERE suite = 5 AND queue = 0 AND in_queue = true AND filename ~ 'd(sc|eb)$'" > $dbdir/dists/unstable_accepted.list
128 symlinks -d /srv/incoming.debian.org/buildd > /dev/null
129 apt-ftparchive generate apt.conf.buildd
131 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
140 # Fetch bugs information before unchecked processing is allowed again.
141 $base/testing/britney allowdaklock bugs || true
143 ssh buildd@buildd /org/wanna-build/trigger.daily
146 echo Archive maintenance finished at $(date +%X)
148 ################################################################################
150 echo "Creating post-daily-cron-job backup of projectb database..."
151 POSTDUMP=$base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
152 pg_dump projectb > $POSTDUMP
153 (cd $base/backup; ln -sf $POSTDUMP current)
155 ################################################################################
157 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
159 # Vacuum the database
160 # (JJ, 20-04-2008) disabled, as we have autovacuum set to on in postgres.
161 # refer to http://www.postgresql.org/docs/current/static/routine-vacuuming.html#AUTOVACUUM
162 # which says "Beginning in PostgreSQL 8.1, there is an optional feature called autovacuum,
163 # whose purpose is to automate the execution of VACUUM and ANALYZE commands."
164 # echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
166 echo "Expiring old database dumps..."
167 (cd $base/backup; $scriptsdir/expire_dumps -d . -p -f "dump_*")
169 ################################################################################
171 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
173 # Send a report on NEW/BYHAND packages
174 dak queue-report | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
175 # and one on crufty packages
176 dak cruft-report > $webdir/cruft-report-daily.txt
177 dak cruft-report -s experimental >> $webdir/cruft-report-daily.txt
178 cat $webdir/cruft-report-daily.txt | mail -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org
180 $scriptsdir/dm-monitor >$webdir/dm-uploaders.html
182 ################################################################################
184 # Push katie@merkel so it syncs the projectb there. Returns immediately, the sync runs detached
185 ssh -2 -i ~/.ssh/push_merkel_projectb katie@merkel.debian.org sleep 1
189 #time dak mirror-split
191 ################################################################################
193 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
195 ulimit -m 90000 -d 90000 -s 10000 -v 200000
197 run-parts --report $base/scripts/distmnt
199 echo Daily cron scripts successful.
201 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
205 $scriptsdir/update-ftpstats $base/log/* > $base/misc/ftpstats.data
206 R --slave --vanilla < $base/misc/ftpstats.R
208 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
210 # Clean up apt-ftparchive's databases
213 apt-ftparchive -q clean apt.conf
215 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
217 # Compress psql backups older than a week, but no more than 20 of them
220 find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mtime +7 |
221 sort | head -n20 | while read dumpname; do
222 echo "Compressing $dumpname"
227 ################################################################################