mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-14 05:55:00 -04:00
add user backup / restore for Vagrant
This commit is contained in:
parent
532e8133c6
commit
58e05f63fe
6 changed files with 26 additions and 1 deletions
3
scripts/vagrant/backup.bat
Normal file
3
scripts/vagrant/backup.bat
Normal file
|
@ -0,0 +1,3 @@
|
|||
@ECHO OFF
|
||||
vagrant ssh -c "cd /vagrant/scripts/vagrant && bash backupMongo.sh"
|
||||
|
3
scripts/vagrant/backup.sh
Executable file
3
scripts/vagrant/backup.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
vagrant ssh -c "cd /vagrant/scripts/vagrant && bash backupMongo.sh"
|
||||
|
8
scripts/vagrant/backupMongo.sh
Executable file
8
scripts/vagrant/backupMongo.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
mkdir -p /vagrant/temp
|
||||
cd /vagrant/temp
|
||||
rm -fr backup
|
||||
mkdir backup
|
||||
cd backup
|
||||
mongodump -db coco --collection users
|
||||
mongodump -db coco --collection earnedachievements
|
7
scripts/vagrant/fillMongo.sh
Normal file → Executable file
7
scripts/vagrant/fillMongo.sh
Normal file → Executable file
|
@ -6,4 +6,9 @@ rm -f dump.tar.gz
|
|||
rm -rf dump
|
||||
wget http://analytics.codecombat.com:8080/dump.tar.gz
|
||||
tar xzvf dump.tar.gz --no-same-owner
|
||||
mongorestore
|
||||
mongorestore --drop
|
||||
if [ -d /vagrant/temp/backup ]
|
||||
then
|
||||
cd /vagrant/temp/backup
|
||||
mongorestore
|
||||
fi
|
||||
|
|
3
scripts/vagrant/update.bat
Normal file
3
scripts/vagrant/update.bat
Normal file
|
@ -0,0 +1,3 @@
|
|||
@ECHO OFF
|
||||
vagrant ssh -c "cd /vagrant/scripts/vagrant && bash fillMongo.sh"
|
||||
|
3
scripts/vagrant/update.sh
Executable file
3
scripts/vagrant/update.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
vagrant ssh -c "cd /vagrant/scripts/vagrant && bash fillMongo.sh"
|
||||
|
Loading…
Add table
Reference in a new issue