]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fixing DEST_BASE
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 11 Mar 2012 23:39:08 +0000 (20:39 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 11 Mar 2012 23:39:08 +0000 (20:39 -0300)
share/hydractl/backup-site

index 70baf3d1b85cea9fd6d917ba27792940e76f6881..ec1f8f3d6227c59b375722f3b9832842d259a5b4 100755 (executable)
@@ -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