A few examples of rsync usage

rsync -av --exclude=/root/suncw/swoole /root/suncw /data/backup/1/ Local backup backup /root/suncw directory to /data/backup/1/

rsync -av [email protected]:/data/backup/1/ /root/suncw Backup the directories and files in the remote server directory /data/backup/1 to the local /root/suncw

rsync -av /root/suncw [email protected]:/data/backup/1/ Backup the files in the local directory /root/suncw to the remote server 192.168.1.226 server

 

Under the non-default ssh port, take 56789 as an example

rsync -av -e 'ssh -p 56789' /root/suncw  [email protected]:/data/backup/1/ 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327011135&siteId=291194637