Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 16322  / 3 Years ago, wed, june 23, 2021, 8:16:08

Let say that I have 2 machines:




  • local (centos)

  • remote on IP: 123.123.123.123 ssh port 456 (ubuntu server)



and I want to synchronize my remote folder /home/wolfy/py with my local folder /home/cavo/python.



Can this be done with rsync? Can you give me an example?


More From » rsync

 Answers
5

Try this:



rsync -ave 'ssh -p 456' /home/cavo/python/ [email protected]:/home/wolfy/py/ 


Note that the trailing slashes on the paths are very important, they signal that you are syncing a directory to a directory. The -e switch helps rsync know it is going to be using ssh transport, and while we are specifying the transport we also tell ssh what port it's going to have to use to talk to the remote site. Then the username and remote host ip are specified as part of the target.


[#44029] Friday, June 25, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mugustered

Total Points: 193
Total Questions: 123
Total Answers: 108

Location: Bermuda
Member since Wed, Mar 22, 2023
1 Year ago
mugustered questions
Sat, Nov 19, 22, 07:03, 1 Year ago
Sun, May 29, 22, 11:53, 2 Years ago
Fri, Dec 23, 22, 15:02, 1 Year ago
;