Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GH:E backup/restore scripts

  • Loading branch information...
commit 46ff16b6537356af16e2e391afca4baaec65c023 1 parent a282833
@mizzy authored
Showing with 14 additions and 0 deletions.
  1. +7 −0 ghe-backup.sh
  2. +7 −0 ghe-restore.sh
View
7 ghe-backup.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+BACKUP_DIR=/home/mizzy/backup/ghe
+
+ssh admin@ghe.tokyo.pb -- 'ghe-export-mysql' | gzip > $BACKUP_DIR/mysql-backup.sql.gz
+ssh admin@ghe.tokyo.pb -- 'ghe-export-redis' > $BACKUP_DIR/redis-backup.rdb
+ssh admin@ghe.tokyo.pb -- 'ghe-export-repositories' > $BACKUP_DIR/repositories-backup.tar
View
7 ghe-restore.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+BACKUP_DIR=/home/mizzy/backup/ghe
+
+gzip -dc $BACKUP_DIR/mysql-backup.sql.gz | ssh admin@ghe.tokyo.pb -- 'ghe-import-mysql'
+ssh admin@ghe.tokyo.pb -- 'ghe-import-redis' < $BACKUP_DIR/redis-backup.rdb
+ssh admin@ghe.tokyo.pb -- 'ghe-import-repositories' < $BACKUP_DIR/repositories-backup.tar
Please sign in to comment.
Something went wrong with that request. Please try again.