Permalink
Browse files

Zip couch files

  • Loading branch information...
1 parent fb15699 commit 71dc0934c1dc4d767fe3c81380cad945b07411e6 @wegrata wegrata committed Sep 13, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 backup/backup.sh
View
@@ -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

0 comments on commit 71dc093

Please sign in to comment.