-r : copies data recursively (but don’t preserve timestamps and permission while transferring data.
-a : archive mode, which allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships, and timestamps.
-z : compress file data.
-h : human-readable, output numbers in a human-readable format.
# include those files and directory only which starts with ‘R’ and exclude all other files and directory.
rsync -avze ssh --include 'R*' --exclude '*' root@192.168.0.141:/var/lib/rpm/ /root/rpm
设置文件大小的条件
1
2
# in this example, the Max file size is 200k, so this command will transfer only those files which are equal to or smaller than 200k.
rsync -avzhe ssh --max-size='200k' /var/lib/rpm/ root@192.168.0.151:/root/tmprpm