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
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