Skip to content

Instantly share code, notes, and snippets.

@treehousetim
Last active January 5, 2019 15:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save treehousetim/2a7871f87fa53007f17e to your computer and use it in GitHub Desktop.
Save treehousetim/2a7871f87fa53007f17e to your computer and use it in GitHub Desktop.
rsync example
._*
.DS_Store
.svn
/publish
# 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=../
rsync_server_string=user@example.com
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
@abhijeetcpu
Copy link

how to provide destination server password in rsync command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment