Last active
January 5, 2019 15:49
-
-
Save treehousetim/2a7871f87fa53007f17e 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
._* | |
.DS_Store | |
.svn | |
/publish |
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
# reverse the comments on the next two lines to do a dry run | |
#dryrun=--dry-run | |
dryrun= | |
c=--compress | |
exclude=--exclude-from=rs_exclude.txt | |
pg="--no-p --no-g" | |
#delete is dangerous - use caution. I deleted 15 years worth of digital photos using rsync with delete turned on. | |
# reverse the comments on the next two lines to enable deleting | |
#delete=--delete | |
delete= | |
rsync_options=-Pav | |
rsync_local_path=../ | |
[email protected] | |
rsync_server_path="/home/www.example.com" | |
# choose one. | |
#rsync $rsync_options $dryrun $delete $exclude $c $pg $rsync_local_path $rsync_server_string:$rsync_server_path | |
#how to specify an alternate port | |
#rsync -e "ssh -p 2220" $dryrun $delete $exclude $c $pg $rsync_local_path $rsync_server_string:$rsync_server_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to provide destination server password in rsync command