Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- DIRECTORIES=\
- "app
- public"
- SOURCE="."
- DESTINATION="<user>@<ip>:/destination/home/<user>"
- cd "<path/to/sourcecode>" || exit
- # Directory syncing
- for DIR in $DIRECTORIES; do
- cd "$DIR" || exit
- rsync -avrP --delete-after --rsh='ssh -p <portnumber>' \
- --exclude="media" \
- "$SOURCE" "$DESTINATION/$DIR" 2>&1 > /dev/null
- cd ..
- done
- # File syncing
- rsync -avP --rsh='ssh -p <portnumber>' \
- --include="config.php" \
- --include="route.php" \
- --exclude="*" \
- "$SOURCE" "$DESTINATION" 2>&1 > /dev/null
- echo "Synced all files to remote."
Advertisement
Add Comment
Please, Sign In to add comment