aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-09 20:35:10 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-09 20:35:10 -0300
commitd60dc74257d81d2b04bc5d4b7a1566683a3c3a00 (patch)
tree277944b4ec1ed4e423ed0967d154b82d5f4bbf8e
parentad35d71fd1e23fd27ed38313231d6fbd99e3aec9 (diff)
downloadhydra-d60dc74257d81d2b04bc5d4b7a1566683a3c3a00.tar.gz
hydra-d60dc74257d81d2b04bc5d4b7a1566683a3c3a00.tar.bz2
Support for debian and wiki at backup-site
-rw-r--r--TODO.md2
-rwxr-xr-xshare/hydractl/backup-site12
2 files changed, 9 insertions, 5 deletions
diff --git a/TODO.md b/TODO.md
index 702e7f5..38ff87c 100644
--- 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.
diff --git a/share/hydractl/backup-site b/share/hydractl/backup-site
index ec1f8f3..32c4284 100755
--- a/share/hydractl/backup-site
+++ b/share/hydractl/backup-site
@@ -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*