]> git.decadent.org.uk Git - dak.git/blob - cron.daily
Changed accepted_autobuild to queue_build everywhere.Add a queue table.Add a "queue...
[dak.git] / cron.daily
1 #! /bin/sh
2 #
3 # Executed daily via cron, out of katie's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/ftp.debian.org/katie/vars
7 . $SCRIPTVARS
8
9 ################################################################################
10
11 echo Archive maintenance started at $(date +%X)
12
13 NOTICE="$ftpdir/Archive_Maintenance_In_Progress"
14 LOCKCU="$lockdir/daily.lock"
15 LOCKAC="$lockdir/unchecked.lock"
16
17 cleanup() {
18   rm -f "$NOTICE"
19   rm -f "$LOCKCU"
20 }
21 trap cleanup 0
22
23 rm -f "$NOTICE"
24 lockfile -l 3600 $LOCKCU
25 cat > "$NOTICE" <<EOF
26 Packages are currently being installed and indices rebuilt.
27 Maintenance is automatic, starting at 13:52 US Central time, and
28 ending at about 15:30.  This file is then removed.
29
30 You should not mirror the archive during this period.
31 EOF
32
33 ################################################################################
34
35 echo "Creating pre-daily-cron-job backup of projectb database..."
36 pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
37
38 ################################################################################
39
40 update-bugdoctxt
41 update-mirrorlists
42 update-mailingliststxt
43
44 ################################################################################
45
46 lockfile $LOCKAC
47 cd $accepted
48 rm -f REPORT
49 kelly -pa *.changes | tee REPORT | \
50      mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
51 chgrp debadmin REPORT
52 chmod 664 REPORT
53
54 cd $masterdir
55 cindy
56 rm -f $LOCKAC
57
58 symlinks -d -r $ftpdir
59
60 cd $masterdir
61 jenna
62
63 # Update fingerprints
64 emilie
65
66 # Generate override files
67 cd $overridedir
68 denise
69
70 # Update task overrides for testing and unstable
71 # [JT 2004-02-04 disabled; copying in by hand for now]
72 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
73 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
74
75 # FIXME
76 rm -f override.potato.all3 override.sid.all3
77 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
78 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
79
80 # Generate Packages and Sources files
81 cd $masterdir
82 apt-ftparchive generate apt.conf
83 # Generate *.diff/ incremental updates
84 tiffani
85 # Generate Release files
86 ziyi
87
88 # Clean out old packages
89 rhona
90 shania
91
92 # Needs to be rebuilt, as files have moved.  Due to unaccepts, we need to
93 # update this before wanna-build is updated.
94 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
95 apt-ftparchive generate apt.conf.buildd
96
97 mkmaintainers
98 copyoverrides
99 mklslar
100 mkchecksums
101 rm -f $NOTICE
102 sudo -u archvsync /home/archvsync/pushmerkel
103
104 rm -f $LOCKCU
105 echo Archive maintenance finished at $(date +%X)
106
107 ################################################################################
108
109 echo "Creating post-daily-cron-job backup of projectb database..."
110 POSTDUMP=/org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
111 pg_dump projectb > $POSTDUMP
112 (cd /org/ftp.debian.org/backup; ln -sf $POSTDUMP current)
113
114 ################################################################################
115
116 # Vacuum the database
117 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE:  Skipping.*only table owner can VACUUM it$"
118
119 ################################################################################
120
121 # Send a report on NEW/BYHAND packages
122 helena | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
123 # and one on crufty packages
124 rene | tee $webdir/rene-daily.txt | mail -e -s "rene run for $(date +%D)" ftpmaster@ftp-master.debian.org
125
126 ################################################################################
127
128 # Run billie
129
130 #time billie
131
132 ################################################################################
133
134 ulimit -m 90000 -d 90000 -s 10000 -v 90000
135
136 run-parts --report /org/ftp.debian.org/scripts/distmnt
137
138 echo Daily cron scripts successful.
139 # Stats pr0n
140
141 cd $masterdir
142 update-ftpstats $base/log/* > $base/misc/ftpstats.data
143 R --slave --vanilla < $base/misc/ftpstats.R