]> git.decadent.org.uk Git - dak.git/blob - cron.daily-non-US
f2b4306fcfbdabf19250abe170de08d0eeb70a53
[dak.git] / cron.daily-non-US
1 #! /bin/sh
2 #
3 # Executed daily via cron, out of troup's crontab.
4
5 set -e
6 export SCRIPTVARS=/org/non-us.debian.org/katie/vars-non-US
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/non-us.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
33
34 ################################################################################
35
36 update-readmenonus
37
38 ################################################################################
39
40 if [ ! -z "$(find "$accepted" -name \*.changes -maxdepth 1 -mindepth 1)" ]; then
41   cd $accepted
42   rm -f REPORT
43   kelly -pa *.changes | tee REPORT | \
44      mail -s "Non-US Install for $(date +%D)" ftpmaster@ftp-master.debian.org
45   chgrp debadmin REPORT
46   chmod 664 REPORT
47 fi
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 # FIXME
59 rm -f override.potato.all3
60 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
61
62 # Generate Packages and Sources files
63 cd $masterdir
64 apt-ftparchive generate apt.conf-non-US
65 # Generate Release files
66 ziyi
67
68 # Clean out old packages
69 rhona
70 shania
71
72 # Generate the Maintainers file
73 cd $indices
74 charisma > .new-maintainers_versions
75 mv -f .new-maintainers_versions Maintainers_Versions
76 sed -e "s/~[^  ]*\([   ]\)/\1/" < Maintainers_Versions | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers
77 mv -f .new-maintainers Maintainers
78 gzip -9v <Maintainers >.new-maintainers.gz
79 mv -f .new-maintainers.gz Maintainers.gz
80 gzip -9v <Maintainers_Versions >.new-maintainers_versions.gz
81 mv -f .new-maintainers_versions.gz Maintainers_Versions.gz
82 rm -f Maintainers_Versions
83
84 cd $masterdir
85 copyoverrides
86 mklslar
87 mkchecksums
88
89 rm -f $NOTICE
90 echo Archive maintenance finished at $(date +%X)
91
92 ################################################################################
93
94 echo "Creating post-daily-cron-job backup of projectb database..."
95 pg_dump projectb > /org/non-us.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
96
97 ################################################################################
98
99 # Vacuum the database
100 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE:  Skipping.*only table owner can VACUUM it$"
101
102 ################################################################################
103
104 # Send a report on NEW/BYHAND packages
105 helena | mail -e -s "[non-US] NEW and BYHAND on $(date +%D)" ftpmaster@ftp-master.debian.org
106 # and one on crufty packages
107 rene | mail -e -s "[non-US] rene run for $(date +%D)" ftpmaster@ftp-master.debian.org
108
109 ################################################################################
110 ulimit -m 90000 -d 90000 -s 10000 -v 90000
111
112 run-parts --report /org/non-us.debian.org/scripts/distmnt
113
114 echo Daily cron scripts successful.