Usage: rsync [OPTION]... SRC [SRC]... DEST
or rsync [OPTION]... SRC [SRC]... [USER@]HOST:DEST
or rsync [OPTION]... SRC [SRC]... [USER@]HOST::DEST
or rsync [OPTION]... SRC [SRC]... rsync://[USER@]HOST[:PORT]/DEST
or rsync [OPTION]... [USER@]HOST:SRC [DEST]
or rsync [OPTION]... [USER@]HOST::SRC [DEST]
or rsync [OPTION]... rsync://[USER@]HOST[:PORT]/SRC [DEST]
本地文件夹的同步, 使用的时候要注意判别文件夹后要不要加/:
rsync -av --delete /work/dev/ /code/dev_svn , 将/work/dev/下面的所有文件同步到/code/dev_svn文件夹, /work/dev和/code/dev_svn是同级.
rsync -av --delete /work/dev /code/dev_svn , 就是把/work/dev同步到/code/dev_svn的下面作为它的子目录.
rsync -av --delete /work/dev/app3518.img /work/tftpboot/
rsync -av --delete /work/dev/app3518.img /work/tftpboot/app3518.img; 把rsync -av --delete /work/dev/app3518.img同步到/work/tftpboot/下, 两种写法无区别
.