space-accessstablestagetest-hooks
Last change
on this file since 14e96b3 was
14e96b3,
checked in by Alex Dehnert <adehnert@…>, 14 years ago
|
Script to refresh the new DB from warehouse data
|
-
Property mode set to
100755
|
File size:
861 bytes
|
Line | |
---|
1 | #!/bin/bash -e |
---|
2 | |
---|
3 | author="$USER warehouse-refresh.sh on $(hostname) <asa-db@mit.edu>" |
---|
4 | |
---|
5 | date |
---|
6 | |
---|
7 | cd saved-data |
---|
8 | |
---|
9 | mysqldump --skip-extended-insert asa+forms > data.sql |
---|
10 | |
---|
11 | echo |
---|
12 | echo Committing previous DB: |
---|
13 | git commit data.sql -m "Previous ASA database: $(date +%F)" --allow-empty --author="$author" |
---|
14 | |
---|
15 | echo |
---|
16 | echo Changes in this commit: |
---|
17 | git show |
---|
18 | |
---|
19 | echo |
---|
20 | echo |
---|
21 | echo Performing replacement |
---|
22 | echo "TRUNCATE TABLE groups_group" | mysql asa+forms |
---|
23 | ../import_db.py < ../warehouse-dump.csv > /dev/null |
---|
24 | mysqldump --skip-extended-insert asa+forms > data.sql |
---|
25 | |
---|
26 | echo |
---|
27 | echo Committing new DB: |
---|
28 | git commit data.sql -m "New ASA database: $(date +%F)" --allow-empty --author="$author" |
---|
29 | |
---|
30 | echo |
---|
31 | echo Changes in this commit: |
---|
32 | git show |
---|
33 | |
---|
34 | echo |
---|
35 | echo |
---|
36 | echo Disk usage: |
---|
37 | du -h --max-depth=1 |
---|
38 | |
---|
39 | echo |
---|
40 | echo "gc'ing..." |
---|
41 | time git gc |
---|
42 | echo "repack'ing..." |
---|
43 | time git repack |
---|
44 | |
---|
45 | echo |
---|
46 | echo Disk usage: |
---|
47 | du -h --max-depth=1 |
---|
48 | |
---|
49 | date |
---|
Note: See
TracBrowser
for help on using the repository browser.