]> git.decadent.org.uk Git - dak.git/blob - cron.daily-non-US
enable catherine
[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 cd $incoming
41 rm -f REPORT
42 katie -pak *.changes | direport | tee REPORT | \
43      mail -s "Non-US Install for $(date +%D)" ftpmaster@ftp-master.debian.org
44 chgrp debadmin REPORT
45 chmod 664 REPORT
46
47 catherine
48
49 cd $masterdir
50 symlinks -d -r $ftpdir
51
52 cd $masterdir
53 jenna
54 # FIXME
55 cd /org/non-us.debian.org/database/dists/
56 rm -f proposed-updates_-_all.list
57 for i in proposed-updates_-_binary-* proposed-updates_-_source.list; do cat $i >> proposed-updates_-_all.list; done
58
59 # Generate override files
60 cd $overridedir
61 denise
62 # FIXME
63 rm -f override.potato.all3
64 for i in main contrib non-free; do cat override.potato.$i >> override.potato.all3; done
65
66 # Generate Packages and Sources files
67 cd $masterdir
68 apt-ftparchive generate apt.conf-non-US
69 # Generate Release files
70 ziyi
71
72 # Clean out old packages
73 rhona
74
75 # Generate the Maintainers file
76 cd $indices
77 charisma > .new-maintainers_versions
78 mv -f .new-maintainers_versions Maintainers_Versions
79 sed -e "s/~[^  ]*\([   ]\)/\1/" < Maintainers_Versions | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers
80 mv -f .new-maintainers Maintainers
81 gzip -9v <Maintainers >.new-maintainers.gz
82 mv -f .new-maintainers.gz Maintainers.gz
83 gzip -9v <Maintainers_Versions >.new-maintainers_versions.gz
84 mv -f .new-maintainers_versions.gz Maintainers_Versions.gz
85 rm -f Maintainers_Versions
86
87 cd $masterdir
88 copyoverrides
89 mklslar
90 mkchecksums
91
92 rm -f $NOTICE
93 echo Archive maintenance finished at $(date +%X)
94
95 ################################################################################
96
97 echo "Creating post-daily-cron-job backup of projectb database..."
98 pg_dump projectb > /org/non-us.debian.org/backup/dump_$(date +%Y.%m.%d-%H:%M:%S)
99
100 ################################################################################
101
102 # Vacuum the database
103 echo "VACUUM; VACUUM ANALYZE;" | psql projectb 2>&1 | grep -v "^NOTICE:  Skipping.*only table owner can VACUUM it$"
104
105 ################################################################################
106
107 ulimit -m 90000 -d 90000 -s 10000 -v 90000
108
109 run-parts --report /org/non-us.debian.org/scripts/distmnt
110
111 echo Daily cron scripts successful.