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 # [JT - disabled, dak import-ldap-fingerprints currently can ask questions]
93 #dak import-ldap-fingerprints
95 # Generate override files
99 # Update task overrides for testing and unstable
100 # [JT 2004-02-04 disabled; copying in by hand for now]
101 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
102 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
105 rm -f override.sid.all3
106 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
108 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
110 # Generate Packages and Sources files
112 apt-ftparchive generate apt.conf
113 # Generate *.diff/ incremental updates
114 dak generate-index-diffs
115 # Generate Release files
116 dak generate-releases
118 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
120 # Clean out old packages
124 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
126 # Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
127 # update this before wanna-build is updated.
128 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
129 symlinks -d /srv/incoming.debian.org/buildd > /dev/null
130 apt-ftparchive generate apt.conf.buildd
132 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
141 # Fetch bugs information before unchecked processing is allowed again.
142 $base/testing/britney allowdaklock bugs || true
144 ssh buildd@buildd /org/wanna-build/trigger.daily
147 echo Archive maintenance finished at $(date +%X)
149 ################################################################################
151 echo "Creating post-daily-cron-job backup of projectb database..."
152 POSTDUMP=$base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
153 pg_dump projectb > $POSTDUMP
154 (cd $base/backup; ln -sf $POSTDUMP current)
156 ################################################################################
158 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
160 # Vacuum the database
161 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
163 ################################################################################
165 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
167 # Send a report on NEW/BYHAND packages
168 dak queue-report | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
169 # and one on crufty packages
170 dak cruft-report | tee $webdir/cruft-report-daily.txt | mail -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org
172 ################################################################################
176 #time dak mirror-split
178 ################################################################################
180 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
182 ulimit -m 90000 -d 90000 -s 10000 -v 90000
184 run-parts --report $base/scripts/distmnt
186 echo Daily cron scripts successful.
188 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
192 $scriptsdir/update-ftpstats $base/log/* > $base/misc/ftpstats.data
193 R --slave --vanilla < $base/misc/ftpstats.R
195 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
197 # Clean up apt-ftparchive's databases
200 apt-ftparchive -q clean apt.conf
202 ################################################################################