diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2010-09-22 18:23:58 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2010-09-22 18:23:58 -0300 |
commit | c36794e899731be16f1045a9ae19878813fd9896 (patch) | |
tree | abbfbfb6d69b2e43b1748822cfbfb2b5c5964bdd /share/hydractl/site-pack | |
parent | fec2db557dcad1f52a1ffa8b612629a0b8b4c054 (diff) | |
download | hydra-c36794e899731be16f1045a9ae19878813fd9896.tar.gz hydra-c36794e899731be16f1045a9ae19878813fd9896.tar.bz2 |
Action changes
Diffstat (limited to 'share/hydractl/site-pack')
-rwxr-xr-x | share/hydractl/site-pack | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/share/hydractl/site-pack b/share/hydractl/site-pack new file mode 100755 index 0000000..6e33dfd --- /dev/null +++ b/share/hydractl/site-pack @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Pack a website. +# +# TODO: put on $SITES/backups/site/$SITE, with htaccess and correct +# ownership/permission. + +# Arguments +SITES="/var/sites" +SITE="$1" +PACK="$1.tar.bz2" + +if [ -z "$SITE" ]; then + hydra_action_usage + exit 1 +elif [ ! -d "$SITE" ]; then + echo "No such site $SITE" + exit 1 +fi + +mkdir -p $SITES/backups +cd $SITES/backups + +tar jcvf $PACK $SITES/$SITE +md5sum $PACK > $PACK.md5 +sha1sum $PACK > $PACK.sha1 + +echo "Saved $SITES/backups/$PACK" |