summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshare/hydractl/backup-site13
1 files changed, 12 insertions, 1 deletions
diff --git a/share/hydractl/backup-site b/share/hydractl/backup-site
index f6aa230..2c448c0 100755
--- a/share/hydractl/backup-site
+++ b/share/hydractl/backup-site
@@ -25,7 +25,8 @@ SITES="/var/sites"
SITE="$1"
PACK="$1.tar.bz2"
DATE="`date +%Y%m%d`"
-DEST="$SITES/backups/site/$SITE/`facter hostname`/$DATE"
+DEST_BASE="$SITES/backups"
+DEST="$DEST_BASE/site/$SITE/`facter hostname`/$DATE"
# Syntax check.
if [ -z "$SITE" ]; then
@@ -54,6 +55,16 @@ else
BACKUPS_GROUP="root"
fi
+# Check destination base index
+mkdir -p $DEST_BASE
+touch $DEST_BASE/index.html
+
+# Check robots.txt
+if [ ! -e "$DEST_BASE/robots.txt" ]; then
+ echo 'User-agent: *' > $DEST_BASE/robots.txt
+ echo 'Disallow: /' >> $DEST_BASE/robots.txt
+fi
+
# Create folder
mkdir -p $DEST
cd $DEST