source: asadb/util/warehouse-refresh.sh @ 14e96b3

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
3author="$USER warehouse-refresh.sh on $(hostname) <asa-db@mit.edu>"
4
5date
6
7cd saved-data
8
9mysqldump --skip-extended-insert asa+forms > data.sql
10
11echo
12echo Committing previous DB:
13git commit data.sql -m "Previous ASA database: $(date +%F)" --allow-empty --author="$author"
14
15echo
16echo Changes in this commit:
17git show
18
19echo
20echo
21echo Performing replacement
22echo "TRUNCATE TABLE groups_group" | mysql asa+forms
23../import_db.py < ../warehouse-dump.csv > /dev/null
24mysqldump --skip-extended-insert asa+forms > data.sql
25
26echo
27echo Committing new DB:
28git commit data.sql -m "New ASA database: $(date +%F)" --allow-empty --author="$author"
29
30echo
31echo Changes in this commit:
32git show
33
34echo
35echo
36echo Disk usage:
37du -h --max-depth=1
38
39echo
40echo "gc'ing..."
41time git gc
42echo "repack'ing..."
43time git repack
44
45echo
46echo Disk usage:
47du -h --max-depth=1
48
49date
Note: See TracBrowser for help on using the repository browser.