rsync 命令使用
首先rsync命令是單向同步,
rsync -avv left/ right/
right不會影響到left。
排除文件(夾)
rsync -arv --exclude-from='/home/ben/exclude_me.txt' /home/ben /media/ben/thumbdrive/
exclude_me.txt
.ccache
build
.java
.gvfs
.xsession-errors
/dir/means exclude the root folder/dir/dir/*means get the root folder/dirbut not the contentsdir/means exclude any folder anywhere where the name containsdir/
遠程到本地
rsync -a username@remote_host:/home/username/dir1 place_to_sync_on_local_machine
本地到遠程
rsync -a ~/dir1 username@remote_host:destination_directory
浙公網安備 33010602011771號