john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Deploy directories delay function paremeters

!/bin/bash

johnpfeiffer deploy applications slowly

DIRECTORY=/var/lib/tomcat6/STAGING TARGET=/var/lib/tomcat6/webapps

function wait() { echo "waiting 30" ping -c30 127.0.0.1 > /dev/null }

function alphabetical() { SOURCEDIRS=/var/lib/tomcat6/STAGING/* for dir in $SOURCEDIRS do echo "processing $dir..." wait done } # end alphabetical

needs tests for exists $DIRECTORY and $TARGET

function movedirectory() { if [ $# -ne 1 ]; then echo "no parameter" exit 0 else SOURCE=$DIRECTORY/$1 if [ -d $SOURCE ]; then echo "mv $SOURCE $TARGET" mv $SOURCE $TARGET wait else echo "$1 not found" fi

fi

} # end movedirectory

----- main ----

clear

/etc/init.d/tomcat6 stop

echo "resetting services" mv $TARGET/* $DIRECTORY

/etc/init.d/tomcat6 start

movedirectory appone movedirectory apptwo movedirectory appthree


  • « drupal 6 to drupal 7 upgrade checklist
  • Perl system commands »

Published

Oct 5, 2011

Category

linux

~91 words

Tags

  • delay 1
  • deploy 3
  • directories 3
  • function 14
  • paremeters 1
  • scripts 63