Created
July 17, 2012 09:44
-
-
Save FrancisVarga/3128389 to your computer and use it in GitHub Desktop.
easy rsync deployment
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/sh | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
echo "===========================================" | |
echo "Deploy started!" | |
echo "===========================================" | |
RSYNC="`which rsync`" | |
IGNORE_FILE="$DIR/rsyncignore" | |
INCLUDE_FILE="$DIR/rsyncfolders" | |
TIMESTAMP_COMMAND=$(date +%s) | |
LOG_FILE=logs/deploy/mobile/$TIMESTAMP_COMMAND.txt | |
USER_NAME="" | |
HOST="" | |
PATH="" | |
for f in $(cat $INCLUDE_FILE); | |
do | |
COMMAND="${RSYNC} -craipv --exclude-from=${IGNORE_FILE} $f ${USER_NAME}@${HOST}:${PATH}" | |
$COMMAND 1>> $LOG_FILE | |
done | |
cat $LOG_FILE | |
echo "===========================================" | |
echo "Finished Deploy!" | |
echo "===========================================" | |
# EOF |
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
application | |
htdocs | |
library | |
bin | |
build |
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
.DS_Store | |
.idea | |
.rsyncignore | |
.git | |
.gitignore | |
.gitmodules | |
.project | |
.settings | |
.svn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment