Skip to content

Instantly share code, notes, and snippets.

@FrancisVarga
Created July 17, 2012 09:44
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 FrancisVarga/3128389 to your computer and use it in GitHub Desktop.
Save FrancisVarga/3128389 to your computer and use it in GitHub Desktop.
easy rsync deployment
#!/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
application
htdocs
library
bin
build
.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