Simple Rsync based container to keep two directories in sync.
This container is intended to be used to keep 2 docker volumes (local path, named, cifs etc) in sync.
The rsync job can be customized using env variable, refer below.
Multi Arch Docker Image can be found on https://hub.docker.com/r/sudipthegreat/docker-sync-folders
version: '3.3'
services:
docker-sync-folders:
image: 'sudipthegreat/docker-sync-folders:latest'
restart: always
environment:
- 'RSYNC_OPTIONS:-rvWPh --size-only'
- 'SYNC_FREQUENCY:300'
volumes:
- 'my-named-vol:/source'
- '/path/to/dest/on/host:/destination'
| Name | Description |
|---|---|
| /source | Source Directory in the container. Override with your source directory from host |
| /destination | Target Directory in the container. Override with your target directory from host |
| Env Variable | Description |
|---|---|
| RSYNC_OPTIONS | Rsync Options to customize sync behavior. Full list can be found here |
| SYNC_FREQUENCY | The interval in seconds post which the rsync job will be run again |