From 7796761af156ece9a7307c2e09894774aca25834 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 6 Mar 2012 10:45:14 -0300 Subject: Check index and robots.txt on backup-site --- share/hydractl/backup-site | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'share/hydractl') 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 -- cgit v1.2.3