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