{"id":21614767,"url":"https://github.com/eea/eea.docker.rsync","last_synced_at":"2025-07-12T07:02:55.841Z","repository":{"id":14663301,"uuid":"55712660","full_name":"eea/eea.docker.rsync","owner":"eea","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-28T01:02:31.000Z","size":22,"stargazers_count":41,"open_issues_count":5,"forks_count":42,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-05-19T23:05:24.375Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eea.png","metadata":{"files":{"readme":"Readme.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-07T17:03:35.000Z","updated_at":"2025-05-09T17:03:50.000Z","dependencies_parsed_at":"2024-08-08T16:58:56.040Z","dependency_job_id":"b96c7797-34bc-4933-b401-22ce2e531ec8","html_url":"https://github.com/eea/eea.docker.rsync","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/eea/eea.docker.rsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eea%2Feea.docker.rsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eea%2Feea.docker.rsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eea%2Feea.docker.rsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eea%2Feea.docker.rsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eea","download_url":"https://codeload.github.com/eea/eea.docker.rsync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eea%2Feea.docker.rsync/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264951987,"owners_count":23687994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T22:09:17.904Z","updated_at":"2025-07-12T07:02:55.825Z","avatar_url":"https://github.com/eea.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple rsync container based on alpine\n\nA simple rsync server/client Docker image to easily rsync data within Docker volumes\n\n## Simple Usage\n\nGet files from remote server within a `docker volume`:\n\n    $ docker run --rm -v blobstorage:/data/ eeacms/rsync \\\n             rsync -avzx --numeric-ids user@remote.server.domain.or.ip:/var/local/blobs/ /data/\n\nGet files from `remote server` to a `data container`:\n\n    $ docker run -d --name data -v /data busybox\n    $ docker run --rm --volumes-from=data eeacms/rsync \\\n             rsync -avz user@remote.server.domain.or.ip:/var/local/blobs/ /data/\n\n## Advanced Usage\n\n### Client setup\n\nStart client to pack and sync every night:\n\n    $ docker run --name=rsync_client -v client_vol_to_sync:/data \\\n                 -e CRON_TASK_1=\"0 1 * * * /data/pack-db.sh\" \\\n                 -e CRON_TASK_2=\"0 3 * * * rsync -e 'ssh -p 2222' -aqx --numeric-ids root@foo.bar.com:/data/ /data/\" \\\n             eeacms/rsync client\n\nCopy the client SSH public key printed found in console\n\n### SSH key persistence - client\n\nTo use the same generated keys on docker container re-creation, you need to persist the key directory ( `/root/.ssh` ) in a Docker volume. On first start the keys will be created, and then, on all subsequent starts they will be re-used. \n\nFor example, you can use a volume called `ssh-key` like this:\n\n    $ docker run --name=rsync_client -v ssh-key:/root/.ssh -v client_vol_to_sync:/data\n             eeacms/rsync client\n\n\n### SSH key persistence - server\n\nTo use the same generated host keys on docker container re-creation, you need to persist the host key directory ( `/ssh_host_keys` ) in a Docker volume. On first start the keys will be created, and then, on all subsequent starts they will be re-used. \n\n    $ docker run --name=rsync_server -v ssh-host-keys:/ssh_host_keys -v server_vol_to_sync:/data\n             eeacms/rsync server\n             \nIf you want the rsync client to skip checking the ssh host keys, you can always add this 2 parameters to your client ssh configuration `-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no`\n\n### Server setup\n\nStart server on `foo.bar.com`\n\n    # docker run --name=rsync_server -d -p 2222:22 -v ssh-host-keys:/ssh_host_keys -v server_vol_to_sync:/data \\\n                 -e SSH_AUTH_KEY_1=\"\u003cSSH KEY FROM rsync_client\u003e\" \\\n                 -e SSH_AUTH_KEY_n=\"\u003cSSH KEY FROM rsync_client_n\u003e\" \\\n             eeacms/rsync server\n\n### Verify that it works\n\nAdd `test` file on server:\n\n    $ docker exec -it rsync_server sh\n      $ touch /data/test\n\nBring the `file` on client:\n\n    $ docker exec -it rsync_client sh\n      $ rsync -e 'ssh -p 2222' -avz root@foo.bar.com:/data/ /data/\n      $ ls -l /data/\n      \n### Rsync data between containers in Rancher\n\n0. Request TCP access to port 2222 to an accessible server of environment of the new installation from the source container host server.\n\n1. Start **rsync client** on host from where do you want to migrate data (ex. production). \n\n    Infrastructures -\u003e Hosts -\u003e  Add Container\n    * Select image: eeacms/rsync\n    * Command: sh\n    * Volumes -\u003e Volumes from: Select source container\n\n2. Open logs from container, copy the ssh key from the message\n\n2. Start **rsync server** on host from where do you want to migrate data (ex. devel). The destination container should be temporarily moved to an accessible server ( if it's not on one ) .\n\n    Infrastructures -\u003e Hosts -\u003e  Add Container\n    * Select image: eeacms/rsync\n    * Port map -\u003e +(add) : 2222:22\n    * Command: server\n    * Add environment variable: SSH_AUTH_KEY=\"\u003cSSH-KEY-FROM-R-CLIENT-ABOVE\u003e\"\n    * Volumes -\u003e Volumes from: Select destination container\n\n\n3. Within **rsync client** container from step 1 run:\n\n  ```\n    $ rsync -e 'ssh -p 2222' -avz \u003cSOURCE_DUMP_LOCATION\u003e root@\u003cTARGET_HOST_IP_ON_DEVEL\u003e:\u003cDESTINATION_LOCATION\u003e\n  ```\n  \n4. The rsync servers can be deleted, and the destination container can be moved back ( if needed )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feea%2Feea.docker.rsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feea%2Feea.docker.rsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feea%2Feea.docker.rsync/lists"}