aboutsummaryrefslogtreecommitdiff
path: root/share/hydractl
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-03-11 20:39:08 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-03-11 20:39:08 -0300
commit02dc243883d5e5a827c4cb1f3eb94288a97fbb57 (patch)
tree7129aa9bd061647103d67fd46b5491a8dcbc4121 /share/hydractl
parentb54f7b0e304b0b1888f1eaf4f211d9a37d2c3863 (diff)
downloadhydra-02dc243883d5e5a827c4cb1f3eb94288a97fbb57.tar.gz
hydra-02dc243883d5e5a827c4cb1f3eb94288a97fbb57.tar.bz2
Fixing DEST_BASE
Diffstat (limited to 'share/hydractl')
-rwxr-xr-xshare/hydractl/backup-site10
1 files changed, 7 insertions, 3 deletions
diff --git a/share/hydractl/backup-site b/share/hydractl/backup-site
index 70baf3d..ec1f8f3 100755
--- a/share/hydractl/backup-site
+++ b/share/hydractl/backup-site
@@ -25,8 +25,8 @@ SITES="/var/sites"
SITE="$1"
PACK="$1.tar.bz2"
DATE="`date +%Y%m%d`"
-DEST_BASE="$SITES/backups"
-DEST_BASE_SITE="$DEST_BASE/site/$SITE"
+DEST_BASE="$SITES/backups/site"
+DEST_BASE_SITE="$DEST_BASE/$SITE"
DEST="$DEST_BASE_SITE/`facter hostname`/$DATE"
# Syntax check.
@@ -60,8 +60,12 @@ fi
mkdir -p $DEST_BASE
touch $DEST_BASE/index.html
+# Fix old paths
+rm -f $DEST_BASE/../index.html
+rm -f $DEST_BASE/../robots.txt
+
# Check robots.txt
-if [ ! -e "$DEST_BASE/robots.txt" ]; then
+if [ ! -e "$DEST_BASE/site/robots.txt" ]; then
echo 'User-agent: *' > $DEST_BASE/robots.txt
echo 'Disallow: /' >> $DEST_BASE/robots.txt
fi