aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/hydra/functions1
-rwxr-xr-xshare/hydractl/backup-restore11
-rwxr-xr-xshare/hydractl/gitosis-restore0
-rwxr-xr-xshare/hydractl/site-pack1
-rwxr-xr-xshare/hydractl/site-restore22
-rwxr-xr-xshare/hydractl/svn-restore0
6 files changed, 35 insertions, 0 deletions
diff --git a/lib/hydra/functions b/lib/hydra/functions
index b07e523..e6cf4a0 100644
--- a/lib/hydra/functions
+++ b/lib/hydra/functions
@@ -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
index 0000000..581ac63
--- /dev/null
+++ b/share/hydractl/backup-restore
@@ -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
index 0000000..e69de29
--- /dev/null
+++ b/share/hydractl/gitosis-restore
diff --git a/share/hydractl/site-pack b/share/hydractl/site-pack
index ce6d232..2d1175b 100755
--- a/share/hydractl/site-pack
+++ b/share/hydractl/site-pack
@@ -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
index 0000000..493fc30
--- /dev/null
+++ b/share/hydractl/site-restore
@@ -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
index 0000000..e69de29
--- /dev/null
+++ b/share/hydractl/svn-restore