]> gitweb.fluxo.info Git - hydra.git/commitdiff
More backup actions
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 17:43:16 +0000 (14:43 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 27 Sep 2011 17:43:16 +0000 (14:43 -0300)
lib/hydra/functions
share/hydractl/backup-restore [new file with mode: 0755]
share/hydractl/gitosis-restore [new file with mode: 0755]
share/hydractl/site-pack
share/hydractl/site-restore [new file with mode: 0755]
share/hydractl/svn-restore [new file with mode: 0755]

index b07e523d40b7bf560a94fae3bfb173666939902c..e6cf4a06771ed15f893663f0d35bde993ca66302 100644 (file)
@@ -8,6 +8,7 @@ source $APP_BASE/lib/hydra/git
 source $APP_BASE/lib/hydra/misc
 source $APP_BASE/lib/hydra/usage
 source $APP_BASE/lib/hydra/action
+source $APP_BASE/lib/hydra/backup
 source $APP_BASE/lib/hydra/config
 source $APP_BASE/lib/hydra/tmpfile
 
diff --git a/share/hydractl/backup-restore b/share/hydractl/backup-restore
new file mode 100755 (executable)
index 0000000..581ac63
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Backup restoration.
+#
+
+# Load.
+source $APP_BASE/lib/hydra/functions || exit 1
+hydra_config_load
+
+hydra_backup_environment $*
+duplicity restore file:///$BACKUPDIR/ $RESTOREDIR/
diff --git a/share/hydractl/gitosis-restore b/share/hydractl/gitosis-restore
new file mode 100755 (executable)
index 0000000..e69de29
index ce6d232396a6408d46c538b410ee08e9bacb5a50..2d1175b115f4c592a6f3bc58bc91017a8c119a1e 100755 (executable)
@@ -4,6 +4,7 @@
 #
 # TODO: put on $SITES/backups/site/$SITE, with htaccess and correct
 #       ownership/permission.
+# TODO: optionally backup database before packing
 
 # Arguments
 SITES="/var/sites"
diff --git a/share/hydractl/site-restore b/share/hydractl/site-restore
new file mode 100755 (executable)
index 0000000..493fc30
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Restore a website from backup
+#
+
+# Load.
+source $APP_BASE/lib/hydra/functions || exit 1
+hydra_config_load
+
+SITE="$3"
+
+if [ -z "$SITE" ]; then
+  hydra_action_usage
+  exit 1
+fi
+
+hydra_backup_environment $*
+
+# Check if there's already a site folder and backup it
+# Check installed platforms: trac, drupal, pmwiki
+# Drupal: check symlinks
+# Fix permissions
diff --git a/share/hydractl/svn-restore b/share/hydractl/svn-restore
new file mode 100755 (executable)
index 0000000..e69de29