]> gitweb.fluxo.info Git - hydra.git/commitdiff
Support for debian and wiki at backup-site
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Mar 2014 23:35:10 +0000 (20:35 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 9 Mar 2014 23:35:10 +0000 (20:35 -0300)
TODO.md
share/hydractl/backup-site

diff --git a/TODO.md b/TODO.md
index 702e7f57a8bd4642a9a2779e052226f3473b0ef9..38ff87cbef8773744181610cd1bf78aef9be0717 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -13,5 +13,5 @@ Hydractl
   - puppet-setup-stored: configure storeconfigs database.
   - site backup, copy and restoration: include home folder when available?
   - backup-restore-user and backup-restore-users.
-  - hydractl {backup,restore}-site {debian,wiki}.
+  - hydractl backup-restore-site {debian,wiki}.
   - wrapper to import/export monkeysphere keys into keyringer.
index ec1f8f3d6227c59b375722f3b9832842d259a5b4..32c4284e5d982551eb067f87ce54f8dab711447d 100755 (executable)
@@ -36,10 +36,14 @@ if [ -z "$SITE" ]; then
 fi
 
 # Determine site location.
-if [ "$SITE" == "git" ] && [ "$SITE" == "svn" ]; then
-  LOCATION="/var"
+if [ "$SITE" == "git" ] || [ "$SITE" == "svn" ]; then
+  LOCATION="/var/$SITE"
+elif [ "$SITE" == "debian" ]; then
+  LOCATION="/var/reprepro"
+elif [ "$SITE" == "wiki" ]; then
+  LOCATION="/var/www/data/wiki/"
 else
-  LOCATION="$SITES"
+  LOCATION="$SITES/$SITE"
 fi
 
 # Set backups user.
@@ -94,7 +98,7 @@ fi
 # Backup site
 if [ -d "$SITES/$SITE" ]; then
   echo "Backing up site folder..."
-  tar jcvf $PACK $LOCATION/$SITE
+  tar jcvf $PACK $LOCATION
   md5sum $PACK  > $PACK.md5
   sha1sum $PACK > $PACK.sha1
   chown root.$BACKUPS_GROUP $PACK*