#!/bin/sh

TARGET_DIR=`date +%Y.%m.%d-%H.%M`

mkdir /home/r/proj/6.034/archive/$TARGET_DIR

cd /home/r/proj/6.034/archive/$TARGET_DIR


python2 /home/r/bin/gcp.py -f csv -p 68686960606- bortreb@gmail.com:/all/all/6.034* .
python2 /home/r/bin/gcp.py -p 68686960606- bortreb@gmail.com:/all/all/6.034* .

echo "Backup tester DB"

mysqldump -h sql.mit.edu -ptU45~br8nz -u \
    6.034 6034+fall12_tester > ./6.034-tester.sql

echo "Backup wiki DB"

mysqldump -h sql.mit.edu -ptU45~br8nz -u \
    6.034 6034+fall12_wiki > ./6.034-wiki.sql

echo "Backup all-databases"

mysqldump -h sql.mit.edu -ptU45~br8nz -u \
    6.034 --all-databases > ./6.034-all-databases.sql

du -shc ./*

