]> git.decadent.org.uk Git - dak.git/blob - cron.daily
2004-11-27 James Troup <james@nocrew.org> * katie.conf (Dinstall::DefaultSuite...
[dak.git] / cron.daily
1 #! /bin/sh
2 #
3 # Executed daily via cron, out of troup'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
15 cleanup() {
16   rm -f "$NOTICE"
17 }
18 trap cleanup 0
19
20 rm -f "$NOTICE"
21 cat > "$NOTICE" <<EOF
22 Packages are currently being installed and indices rebuilt.
23 Maintenance is automatic, starting at 13:52 US Central time, and
24 ending at about 15:30.  This file is then removed.
25
26 You should not mirror the archive during this period.
27 EOF
28
29 ################################################################################
30
31 echo "Creating pre-daily-cron-job backup of projectb database..."
32 pg_dump projectb > /org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
33
34 ################################################################################
35
36 update-bugdoctxt
37 update-mirrorlists
38 update-mailingliststxt
39
40 ################################################################################
41
42 cd $accepted
43 rm -f REPORT
44 kelly -pa *.changes | tee REPORT | \
45      mail -s "Install for $(date +%D)" ftpmaster@ftp-master.debian.org
46 chgrp debadmin REPORT
47 chmod 664 REPORT
48
49 cd $masterdir
50 symlinks -d -r $ftpdir
51
52 cd $masterdir
53 jenna
54
55 # Generate override files
56 cd $overridedir
57 denise
58
59 # Update task overrides for testing and unstable
60 # [JT 2004-02-04 disabled; copying in by hand for now]
61 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sarge.extra.main
62 #cat $extoverridedir/task | perl -ne 'print if /^\S+\sTask\s\S+(,\s*\S+)*$/;' > override.sid.extra.main
63
64 # FIXME
65 rm -f override.potato.all3 override.sid.all3
66 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
67 for i in main contrib non-free main.debian-installer; do cat override.sid.$i >> override.sid.all3; done
68
69 # Generate Packages and Sources files
70 cd $masterdir
71 apt-ftparchive generate apt.conf
72 # Generate Release files
73 ziyi
74
75 # Clean out old packages
76 rhona
77 shania
78
79 mkmaintainers
80 copyoverrides
81 mklslar
82 mkchecksums
83
84 rm -f $NOTICE
85 echo Archive maintenance finished at $(date +%X)
86
87 ################################################################################
88
89 echo "Creating post-daily-cron-job backup of projectb database..."
90 POSTDUMP=/org/ftp.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
91 pg_dump projectb > $POSTDUMP
92 (cd /org/ftp.debian.org/backup; ln -sf $POSTDUMP current)
93
94 ################################################################################
95
96 # Vacuum the database
97 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE:  Skipping.*only table owner can VACUUM it$"
98
99 ################################################################################
100
101 # Send a report on NEW/BYHAND packages
102 helena | mail -e -s "NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
103 # and one on crufty packages
104 rene | mail -e -s "rene run for $(date +%D)" ftpmaster@ftp-master.debian.org
105
106 ################################################################################
107
108 # Run billie
109
110 time billie
111
112 ################################################################################
113
114 ulimit -m 90000 -d 90000 -s 10000 -v 90000
115
116 run-parts --report /org/ftp.debian.org/scripts/distmnt
117
118 echo Daily cron scripts successful.