Skip to content

Instantly share code, notes, and snippets.

@joet3ch
Created September 17, 2010 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joet3ch/583614 to your computer and use it in GitHub Desktop.
Save joet3ch/583614 to your computer and use it in GitHub Desktop.
#!/bin/bash
##
## update web site
##
if [ -f /tmp/site_update.lock ]; then
echo "This application is already running! You must manually clear the lockfile: /tmp/site_update.lock"
exit 1
fi
touch /tmp/site_update.lock
DATI=`date +'%m%d%y%H%M%S'`
mkdir /var/www/sites/$1/VERSIONS/${DATI}/
cd /var/www/sites/$1/VERSIONS/${DATI}/
tar -xzf /tmp/$1.tgz
chown apache:apache -R /var/www/sites/$1/VERSIONS/${DATI}
rm -rf /var/www/sites/$1/PROD
cd /var/www/sites/$1/
ln -s /var/www/sites/$1/VERSIONS/${DATI}/ PROD
rm -rf /tmp/site_update.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment