Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Zip couch files

  • Loading branch information...
commit 71dc0934c1dc4d767fe3c81380cad945b07411e6 1 parent fb15699
@wegrata wegrata authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 backup/backup.sh
View
10 backup/backup.sh
@@ -1,7 +1,15 @@
#!/bin/bash
-BACKUPDIR=(/var/log/learningregistry /mnt/couchdb/1.0.2 /var/log/nginx)
+COUCHDIR=/var/lib/couchdb/1.0.1/
+COUCHZIPDIR=~/couchzip
+mkdir $COUCHZIPDIR
+BACKUPDIR=(/var/log/learningregistry /mnt/couchdb/1.0.1 /var/log/nginx $COUCHZIPDIR)
BACKROOT=s3://lr.backups/$1/$2
+for f in $COUCHDIR*.couch
+do
+ tar cjf $COUCHZIPDIR/${f:${#COUCHDIR}}.tar.bz2 $f
+done
for d in ${BACKUPDIR[@]}
do
s3cmd sync --recursive $d/* $BACKROOT$d/
done
+rm -rf $COUCHZIPDIR
Please sign in to comment.
Something went wrong with that request. Please try again.