Rsync-Dir is designed to replicate a specified directory to a data store: ETCD or REDIS or S3.
822
Rsync-Dir is program (available for Windows and Linux) designed to replicate a specified directory to a data store:
Amazon S3. This can be either the AWS (Amazon)
S3 cloud service or a Minio S3 server instance (local or cloud),Only files available in the main directory or the entire tree can be replicated. This is determined by recursive parameter. The application also allows you to specify which types of files are subject to replication and which of them are to be ignored. There are also two replication modes available:
In order to improve the efficiency of sending a file to the data store, the program has implemented a mechanism for dividing files into smaller fragments (called chunks), for which checksums are calculated, thanks to which only those fragments of the file that have changed are sent to the store, not entire files. In the case of deleting a file from a directory, this file can be deleted from the data store, when the assumption is to reflect the state of the monitored directory in the data store. This is decided by the delete action in the actions parameter. The program also supports changing the file name.
The program has implemented several available actions taken by the application:
start – basic action to start monitoring the specified directory – activating instant replication, in which the file is sent to the data store immediately after detecting a change,
mtime – activating cyclic replication – changes in files are detected cyclically,
restore – restoring the state of the directory based on the data store. This action can be standalone and can be the only action taken by the application. It can be used to periodically restore the state of the directory on another server/node/pod,
delete – deleting all files from the datastore. This action can be standalone and may be the only action taken by the application. It can be used to reset the datastore from previously saved data.
The restore and delete actions can be combined with the start and mtime actions. Then the order of execution of the actions is as follows:
You can run the default rsync-dir command simply (synchronization with Amazon S3):
docker run -itd --name rsync-dir \
--env ENV_RSYNCDIR_BUCKET_S3="AWS_BUCKET_S3" \
--env ENV_RSYNCDIR_ACCESS_KEY_S3="AWS_ACCESS_KEY_S3" \
--env ENV_RSYNCDIR_SECRET_KEY_S3="AWS_SECRET_KEY_S3" \
--env ENV_RSYNCDIR_LICENSE="LICENSE_STRING" \
gemail/rsync-dir:latest
If the variables indicated above are specified correctly, the correctness of the connection to S3 can be checked with the command:
docker logs rsync-dir
Correct startup looks like this:
Starting Rsync-Dir...
Rsync-DIR v. 1.78 - dir replicator
EoL:20251230
2025-06-27 10:33:08 - Rsync-DIR START
2025-06-27 10:33:08 - Action: RESTORE START
2025-06-27 10:33:08 - Connected to MINIO[s3.amazonaws.com:443]
2025-06-27 10:33:09 - File:/usr/rsync-dir/data/test.txt checked
2025-06-27 10:33:09 - File:/usr/rsync-dir/data/test.txt read chunk nr: 0
2025-06-27 10:33:09 - File:/usr/rsync-dir/data/test.txt identical - not restored
2025-06-27 10:33:09 - Action: RESTORE STOP
2025-06-27 10:33:09 - Action: DELETE START
2025-06-27 10:33:09 - Connected to MINIO[s3.amazonaws.com:443]
2025-06-27 10:33:10 - File:rsync-base/test.txt deleted from MINIO
2025-06-27 10:33:10 - Action: DELETE STOP
2025-06-27 10:33:10 - Action: START START
The most common problem is providing an incorrect license, which is indicated as follows:
Starting Rsync-Dir...
Rsync-DIR v. 1.78 - dir replicator
Error: License not valid or not correct
/usr/rsync-dir
You may also experience authentication issues on the Amazon S3 side if you provide incorrect values for:
Starting Rsync-Dir...
Rsync-DIR v. 1.78 - dir replicator
EoL:20251230
2025-06-27 11:00:22 - Rsync-DIR START
2025-06-27 11:00:22 - Action: RESTORE START
2025-06-27 11:00:22 - Connected to MINIO[s3.amazonaws.com:443]
2025-06-27 11:00:22 - S3 operation failed; code: SignatureDoesNotMatch, message: The request signature we calculated does not match the signature you provided. Check your key and signing method.(...)
2025-06-27 11:00:22 - Action: RESTORE STOP
To verify operation, you can log in to the container:
docker exec -it rsync-dir bash
and change file test.txt in directory /usr/rsync-dir/data (default monitored directory).
After that check log:
docker logs rsync-dir
or log in to Amazon S3 console and check bucket indicated in the variable ENV_RSYNCDIR_BUCKET_S3.
List only for default configuration:
In Kubernetes clusters without persistent volumes support - as we know, pods are ephemeral and all data saved by the application on disk is lost in the event of a pod failure. If we want the application to have access to previously created files after a failure, we can use rsync-dir, which will continuously replicate files generated by the application to the selected data store. After a pod failure, by using e.g. an initialization container, we can restore previously replicated files to the state before the failure, and after restoring the files, run the basic container with the appropriate application and with access to previously created files
Based on documentation of rync-dir (you will receive it after purchasing the license) you need to prepare your own configuration file and create configmap:
kubectl create configmap rsync-dir-cm \
--from-file=my-rsync-dir.ini \
--from-literal=ENV_RSYNCDIR_CFG_INI=/config/my-rsync-dir.ini
spec:
containers:
- name: rsync-dir
image: docker.io/gemail/rsync-dir:latest
env:
- name: ENV_RSYNCDIR_CFG_INI
valueFrom:
configMapKeyRef:
name: rsync-dir-cm
key: ENV_RSYNCDIR_CFG_INI
volumeMounts:
- name: config
mountPath: /config
volumes:
- name: config
configMap:
name: rsync-dir-cm
The rsync-dir program can be used in many ways. Here are some examples of its use.
Content type
Image
Digest
sha256:d523bca4f…
Size
93.4 MB
Last updated
about 1 month ago
docker pull gemail/rsync-dir