Created
November 15, 2012 15:28
-
-
Save rezozero/4079182 to your computer and use it in GitHub Desktop.
BASH: Prepare site
This file contains hidden or 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 | |
| # Ambroise Maupate REZO ZERO | |
| echo "---------------------------------------------\n" | |
| echo "---------- Préparation d'un site -----------\n" | |
| echo "---- pour son exportation en production ----\n" | |
| echo "---------------------------------------------\n" | |
| APACHE_ROOT="/var/www/" | |
| CMS_REL_DIR="../RZ-CMS" | |
| if [ -z "$1" ]; then | |
| echo "ERREUR, vous devez fournir le nom du dossier à préparer."; | |
| else | |
| cd $APACHE_ROOT | |
| PREPARED_FOLDER="$1_preparation" | |
| mkdir $PREPARED_FOLDER | |
| cd $APACHE_ROOT$PREPARED_FOLDER | |
| pwd | |
| # Copy unique folders | |
| cp -r ../$1/rz-temp ./ | |
| cp -r ../$1/rz-conf ./ | |
| cp -r ../$1/templates ./ | |
| cp -r ../$1/plugins ./ | |
| cp -r ../$1/cache ./ | |
| cp -r ../$1/fonts ./ | |
| cp -r ../$1/documents ./ | |
| # Copy RZCMS files | |
| cp -r $CMS_REL_DIR/administrator.php ./ | |
| cp -r $CMS_REL_DIR/img ./ | |
| cp -r $CMS_REL_DIR/index.php ./ | |
| cp -r $CMS_REL_DIR/min ./ | |
| cp -r $CMS_REL_DIR/robots.txt ./ | |
| cp -r $CMS_REL_DIR/rz-core ./ | |
| cp -r $CMS_REL_DIR/.htaccess ./ | |
| # Remove image cache | |
| rm -r ./rz-core/SLIR/cache | |
| echo "`ls -la`" | |
| echo "---- Prepare site DONE --> now zipping----\n\n" | |
| cd $APACHE_ROOT | |
| zip -r $PREPARED_FOLDER.zip $PREPARED_FOLDER/* | |
| rm -r $PREPARED_FOLDER | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment