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 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
162 ################################################################################
164 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
166 # Send a report on NEW/BYHAND packages
167 dak queue-report | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
168 # and one on crufty packages
169 dak cruft-report | tee $webdir/cruft-report-daily.txt | mail -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org
171 $scriptsdir/dm-monitor >$webdir/dm-uploaders.html
173 ################################################################################
177 #time dak mirror-split
179 ################################################################################
181 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
183 ulimit -m 90000 -d 90000 -s 10000 -v 200000
185 run-parts --report $base/scripts/distmnt
187 echo Daily cron scripts successful.
189 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
193 $scriptsdir/update-ftpstats $base/log/* > $base/misc/ftpstats.data
194 R --slave --vanilla < $base/misc/ftpstats.R
196 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
198 # Clean up apt-ftparchive's databases
201 apt-ftparchive -q clean apt.conf
203 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
205 # Compress psql backups older than a month, but no more than 20 of them
208 find -maxdepth 1 -mindepth 1 -type f -name 'dump_*' \! -name '*.bz2' \! -name '*.gz' -mtime +30 |
209 sort | head -n20 | while read dumpname; do
210 echo "Compressing $dumpname"
215 ################################################################################