Last active
December 13, 2019 05:14
-
-
Save chrisl8888/3416854 to your computer and use it in GitHub Desktop.
rsync example
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 | |
# -r recursive | |
# -z use compression - turn this off if server need to conserve memory | |
# -t preserve modification times | |
# -p preserve permissions | |
# -l copy symlinks as symlinks | |
# Sync the files from the source to target folder and delete any extraneous folders | |
rsync -rvztpl --delete --stats --rsh=/usr/bin/ssh . sshalias:/var/sites/fooooobarbar.com | |
# Preserve files and not delete missing files | |
# rsync -rvztpl --stats --rsh=/usr/bin/ssh . sshalias:/var/sites/fooooobarbar.com | |
# sycn but only sync sql files | |
# rsync -rvztpl --stats --include "*.sql*" --exclude="*" --rsh=/usr/bin/ssh ec2:/home/ubuntu/db . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment