Last active
December 18, 2015 05:49
-
-
Save splitice/5735398 to your computer and use it in GitHub Desktop.
A deployment script for sites
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## EDIT HERE | |
DOMAIN="domain.com" | |
## NO NEED TO EDIT BELOW THIS LINE ## | |
# Copy to backup | |
cp dev.$DOMAIN ${DOMAIN}_c -R --preserve | |
#chmod 777 ${DOMAIN}_c -R | |
# What is the next revisioned backup? | |
name=$DOMAIN | |
i=0 | |
while [[ -e ${name}_b$i ]] ; do | |
let i++ | |
done | |
name=${name}_b$i | |
# Tell the world | |
echo Backed up to $name | |
# Move the old to revisioned backup | |
mv $DOMAIN $name | |
# Move the new source to the htdocs directory | |
mv ${DOMAIN}_c $DOMAIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment