3 # Executed daily via cron, out of dak's crontab.
6 export SCRIPTVARS=/org/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"
25 lockfile -l 3600 $LOCKCU
27 Packages are currently being installed and indices rebuilt.
28 Maintenance is automatic, starting at 13:52 US Central time, and
29 ending at about 15:30. This file is then removed.
31 You should not mirror the archive during this period.
34 ################################################################################
36 echo "Creating pre-daily-cron-job backup of projectb database..."
37 pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
39 ################################################################################
41 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
44 update-mailingliststxt
46 ################################################################################
48 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
52 dak process-unchecked -pa *.changes | tee REPORT | \
53 mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
57 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
62 symlinks -d -r $ftpdir
64 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
66 dak make-suite-file-list
68 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
71 # [JT - disabled, dak import-ldap-fingerprints currently can ask questions]
72 #dak import-ldap-fingerprints
74 # Generate override files
78 # Update task overrides for testing and unstable
79 # [JT 2004-02-04 disabled; copying in by hand for now]
80 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
81 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
84 rm -f override.potato.all3 override.sid.all3
85 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
86 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
88 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
90 # Generate Packages and Sources files
92 apt-ftparchive generate apt.conf
93 # Generate *.diff/ incremental updates
94 dak generate-index-diffs
95 # Generate Release files
98 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
100 # Clean out old packages
104 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
106 # Needs to be rebuilt, as files have moved. Due to unaccepts, we need to
107 # update this before wanna-build is updated.
108 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
109 apt-ftparchive generate apt.conf.buildd
111 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
119 # Fetch bugs information before unchecked processing is allowed again.
120 /org/ftp.debian.org/testing/britney bugs
122 ssh buildd@buildd /org/wanna-build/trigger.daily
125 echo Archive maintenance finished at $(date +%X)
127 ################################################################################
129 echo "Creating post-daily-cron-job backup of projectb database..."
130 POSTDUMP=/org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
131 pg_dump projectb > $POSTDUMP
132 (cd /org/ftp.debian.org/backup; ln -sf $POSTDUMP current)
134 ################################################################################
136 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
138 # Vacuum the database
139 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE: Skipping.*only table owner can VACUUM it$"
141 ################################################################################
143 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
145 # Send a report on NEW/BYHAND packages
146 dak queue-report | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
147 # and one on crufty packages
148 dak cruft-report | tee $webdir/cruft-report-daily.txt | mail -e -s "Debian archive cruft report for $(date +%D)" ftpmaster@ftp-master.debian.org
150 ################################################################################
154 #time dak mirror-split
156 ################################################################################
158 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
160 ulimit -m 90000 -d 90000 -s 10000 -v 90000
162 run-parts --report /org/ftp.debian.org/scripts/distmnt
164 echo Daily cron scripts successful.
166 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)
169 update-ftpstats $base/log/* > $base/misc/ftpstats.data
170 R --slave --vanilla < $base/misc/ftpstats.R
172 TS=$(($TS+1)); echo Archive maintenance timestamp $TS: $(date +%X)