-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsync
19 lines (15 loc) · 790 Bytes
/
rsync
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# To copy files from remote to local, maintaining file properties and sym-links
# archive mode (-a), compressed (-z), verbose (-v), human-readable numbers (-h), partial and progress (-P):
rsync -avzhP host:file1 :file1 /dest/
rsync -avzhP /source host:/dest
# -u, --update skip files that are newer on the receiver
# --inplace update destination files in-place
# --append append data onto shorter files
# To copy file from local to remote over ssh with non standard port 1234 to
# destination folder in remoteuser's home directory:
rsync -avzhP -e "ssh -p1234" <source> <username>@<host>:<dest>
# show progress
rsync -rvP <src> <dest>
# 排除 .git 目录,xxx 文件
rsync --exclude .git --exclude xxx <src> <dest>
# vim: set ft=sh