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)
58 dak process-accepted -pa *.changes | tee REPORT | \
59 mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
63 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
69 symlinks -d -r $ftpdir
71 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
73 dak make-suite-file-list
75 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
78 # [JT - disabled, dak import-ldap-fingerprints currently can ask questions]
79 #dak import-ldap-fingerprints
81 # Generate override files
85 # Update task overrides for testing and unstable
86 # [JT 2004-02-04 disabled; copying in by hand for now]
87 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
88 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
91 rm -f override.sid.all3
92 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
94 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
96 # Generate Packages and Sources files
98 apt-ftparchive generate apt.conf
99 # Generate *.diff/ incremental updates
100 dak generate-index-diffs
101 # Generate Release files
102 dak generate-releases
104 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
106 # Clean out old packages
110 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
112 # Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
113 # update this before wanna-build is updated.
114 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
115 symlinks -d /srv/incoming.debian.org/buildd > /dev/null
116 apt-ftparchive generate apt.conf.buildd
118 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
127 # Fetch bugs information before unchecked processing is allowed again.
128 $base/testing/britney allowdaklock bugs || true
130 ssh buildd@buildd /org/wanna-build/trigger.daily
133 echo Archive maintenance finished at $(date +%X)
135 ################################################################################
137 echo "Creating post-daily-cron-job backup of projectb database..."
138 POSTDUMP=$base/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
139 pg_dump projectb > $POSTDUMP
140 (cd $base/backup; ln -sf $POSTDUMP current)
142 ################################################################################
144 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
146 # Vacuum the database
147 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
149 ################################################################################
151 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
153 # Send a report on NEW/BYHAND packages
154 dak queue-report | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
155 # and one on crufty packages
156 dak cruft-report | tee $webdir/cruft-report-daily.txt | mail -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org
158 ################################################################################
162 #time dak mirror-split
164 ################################################################################
166 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
168 ulimit -m 90000 -d 90000 -s 10000 -v 90000
170 run-parts --report $base/scripts/distmnt
172 echo Daily cron scripts successful.
174 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
178 $scriptsdir/update-ftpstats $base/log/* > $base/misc/ftpstats.data
179 R --slave --vanilla < $base/misc/ftpstats.R
181 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
183 # Clean up apt-ftparchive's databases
186 apt-ftparchive -q clean apt.conf
188 ################################################################################