From 1f25194c5ab63ee588fa66f09cf30f5994490455 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 27 Sep 2011 14:45:36 -0300 Subject: Renaming actions and adding backup function --- share/hydractl/backup-restore-gitosis | 0 share/hydractl/backup-restore-site | 22 ++++++++++++++++++++++ share/hydractl/backup-restore-svn | 0 share/hydractl/backup-site | 29 +++++++++++++++++++++++++++++ share/hydractl/gitosis-restore | 0 share/hydractl/install-puppet | 4 ---- share/hydractl/puppet-install | 4 ++++ share/hydractl/site-pack | 29 ----------------------------- share/hydractl/site-restore | 22 ---------------------- share/hydractl/svn-restore | 0 10 files changed, 55 insertions(+), 55 deletions(-) create mode 100755 share/hydractl/backup-restore-gitosis create mode 100755 share/hydractl/backup-restore-site create mode 100755 share/hydractl/backup-restore-svn create mode 100755 share/hydractl/backup-site delete mode 100755 share/hydractl/gitosis-restore delete mode 100755 share/hydractl/install-puppet create mode 100755 share/hydractl/puppet-install delete mode 100755 share/hydractl/site-pack delete mode 100755 share/hydractl/site-restore delete mode 100755 share/hydractl/svn-restore (limited to 'share') diff --git a/share/hydractl/backup-restore-gitosis b/share/hydractl/backup-restore-gitosis new file mode 100755 index 0000000..e69de29 diff --git a/share/hydractl/backup-restore-site b/share/hydractl/backup-restore-site new file mode 100755 index 0000000..493fc30 --- /dev/null +++ b/share/hydractl/backup-restore-site @@ -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/backup-restore-svn b/share/hydractl/backup-restore-svn new file mode 100755 index 0000000..e69de29 diff --git a/share/hydractl/backup-site b/share/hydractl/backup-site new file mode 100755 index 0000000..2d1175b --- /dev/null +++ b/share/hydractl/backup-site @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Pack a website. +# +# TODO: put on $SITES/backups/site/$SITE, with htaccess and correct +# ownership/permission. +# TODO: optionally backup database before packing + +# Arguments +SITES="/var/sites" +SITE="$1" +PACK="$1.tar.bz2" + +if [ -z "$SITE" ]; then + hydra_action_usage + exit 1 +elif [ ! -d "$SITES/$SITE" ]; then + echo "No such site $SITE" + exit 1 +fi + +mkdir -p $SITES/backups/$SITE +cd $SITES/backups/$SITE + +tar jcvf $PACK $SITES/$SITE +md5sum $PACK > $PACK.md5 +sha1sum $PACK > $PACK.sha1 + +echo "Saved $SITES/backups/$SITE/$PACK" diff --git a/share/hydractl/gitosis-restore b/share/hydractl/gitosis-restore deleted file mode 100755 index e69de29..0000000 diff --git a/share/hydractl/install-puppet b/share/hydractl/install-puppet deleted file mode 100755 index 0d0e141..0000000 --- a/share/hydractl/install-puppet +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -apt-get update -apt-get install puppet puppetmaster diff --git a/share/hydractl/puppet-install b/share/hydractl/puppet-install new file mode 100755 index 0000000..0d0e141 --- /dev/null +++ b/share/hydractl/puppet-install @@ -0,0 +1,4 @@ +#!/bin/bash + +apt-get update +apt-get install puppet puppetmaster diff --git a/share/hydractl/site-pack b/share/hydractl/site-pack deleted file mode 100755 index 2d1175b..0000000 --- a/share/hydractl/site-pack +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# -# Pack a website. -# -# TODO: put on $SITES/backups/site/$SITE, with htaccess and correct -# ownership/permission. -# TODO: optionally backup database before packing - -# Arguments -SITES="/var/sites" -SITE="$1" -PACK="$1.tar.bz2" - -if [ -z "$SITE" ]; then - hydra_action_usage - exit 1 -elif [ ! -d "$SITES/$SITE" ]; then - echo "No such site $SITE" - exit 1 -fi - -mkdir -p $SITES/backups/$SITE -cd $SITES/backups/$SITE - -tar jcvf $PACK $SITES/$SITE -md5sum $PACK > $PACK.md5 -sha1sum $PACK > $PACK.sha1 - -echo "Saved $SITES/backups/$SITE/$PACK" diff --git a/share/hydractl/site-restore b/share/hydractl/site-restore deleted file mode 100755 index 493fc30..0000000 --- a/share/hydractl/site-restore +++ /dev/null @@ -1,22 +0,0 @@ -#!/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 deleted file mode 100755 index e69de29..0000000 -- cgit v1.2.3