]> git.decadent.org.uk Git - dak.git/blob - config/debian/cron.daily
Stop using silly names, and migrate to a saner directory structure.
[dak.git] / config / debian / 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 # [JT - disabled, emilie currently can ask questions]
65 #emilie
66
67 # Generate override files
68 cd $overridedir
69 denise
70
71 # Update task overrides for testing and unstable
72 # [JT 2004-02-04 disabled; copying in by hand for now]
73 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
74 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
75
76 # FIXME
77 rm -f override.potato.all3 override.sid.all3
78 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
79 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
80
81 # Generate Packages and Sources files
82 cd $masterdir
83 apt-ftparchive generate apt.conf
84 # Generate *.diff/ incremental updates
85 tiffani
86 # Generate Release files
87 ziyi
88
89 # Clean out old packages
90 rhona
91 shania
92
93 # Needs to be rebuilt, as files have moved.  Due to unaccepts, we need to
94 # update this before wanna-build is updated.
95 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
96 apt-ftparchive generate apt.conf.buildd
97
98 mkmaintainers
99 copyoverrides
100 mklslar
101 mkchecksums
102 #
103 # Fetch bugs information before unchecked processing is allowed again.
104 /org/ftp.debian.org/testing/britney bugs
105 rm -f $NOTICE
106 sudo -u archvsync /home/archvsync/pushmerkel
107
108 rm -f $LOCKCU
109 echo Archive maintenance finished at $(date +%X)
110
111 ################################################################################
112
113 echo "Creating post-daily-cron-job backup of projectb database..."
114 POSTDUMP=/org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
115 pg_dump projectb > $POSTDUMP
116 (cd /org/ftp.debian.org/backup; ln -sf $POSTDUMP current)
117
118 ################################################################################
119
120 # Vacuum the database
121 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE:  Skipping.*only table owner can VACUUM it$"
122
123 ################################################################################
124
125 # Send a report on NEW/BYHAND packages
126 helena | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
127 # and one on crufty packages
128 rene | tee $webdir/rene-daily.txt | mail -e -s "rene run for $(date +%D)" ftpmaster@ftp-master.debian.org
129
130 ################################################################################
131
132 # Run billie
133
134 #time billie
135
136 ################################################################################
137
138 ulimit -m 90000 -d 90000 -s 10000 -v 90000
139
140 run-parts --report /org/ftp.debian.org/scripts/distmnt
141
142 echo Daily cron scripts successful.
143 # Stats pr0n
144
145 cd $masterdir
146 update-ftpstats $base/log/* > $base/misc/ftpstats.data
147 R --slave --vanilla < $base/misc/ftpstats.R