0

I am trying to copy directories from our server to a specific docker container on our test server. Therefore i would like to use the rsync command.

I tried the following:

rsync test user@92.374.534.34:9407:/var/www/html

Note: test (the directory), user (ssh user from destination server), 92.374.534.34 (IP from destination server, changed for this question), :9407 (external docker Port for ssh), /var/www/html (destination path)

To avoid being blocked from the firewall, we allowed a ssh connection between both servers.

Here is the displayed error message from the terminal:

rsync: mkdir "/home/user/9407:/var/www/html" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(674) [Receiver=3.1.1]
randomName
  • 123
  • 9
  • 1
    That's not how you specify a port for a ssh connection. [Use the `-p` flag](https://askubuntu.com/a/660556). The error mentions port 9405, your code 9407. – yivi Jan 08 '19 at 08:46
  • @yivi thanks for your response! ...i am not sure how to mix the rsync and docker command correctly. something like this? docker -p 9407:22 rsync test user@92.374.534.34:/var/www/html – randomName Jan 08 '19 at 09:10
  • https://stackoverflow.com/a/49217036/1426539 – yivi Jan 08 '19 at 09:11
  • 1
    You have multiple, unrelated problems. First, are you able to rsync from the **host** to the container at all? Once you do that, try resolving rsync to a non-standard port from outside the host. – yivi Jan 08 '19 at 09:14
  • 2
    You should probably use a r/w volume to share data between the host and the container, and rsync your data to the mapped folder in the host. – yivi Jan 08 '19 at 09:15
  • okay thank you! i will try it :) – randomName Jan 08 '19 at 09:23

0 Answers0