Source: https://github.com/cjimti/irsync
Command line utility and Docker container for running rsync on an interval.
Setup a quick demo using Dockers docker-compose command. Included with this project is a docker-compose.yaml with a simple client/server setup. In this composer configuration irsync is set to check the server every 30 seconds (after sync is complete. The server mounts the ./data/source directory and the client mounts the ./data/dest directory. Drop files in ./data/source and see them appear in ./data/dest.
Setup and run demo (requires Docker):
# create a source and dest directories (mounted from the docker-compose)
mkdir -p ./data/source
mkdir -p ./data/dest
# make a couple of sample files
touch ./data/source/test1.txt
touch ./data/source/test2.txt
# get the docker-compose.yml
curl https://raw.githubusercontent.com/cjimti/irsync/master/docker-compose.yml >docker-compose.yml
# run docker-compose in the background (-d flag)
docker-compose up -d
# view logs
docker-compose logs -f
# drop some more files in the ./data/source directory
# irsync is configured to check every 30 seconds in this demo.
#### Cleanup
# stop containers
docker-compose stop
# remove containers
docker-compose rm
Sync files from a remote server on 30 second interval
docker run --rm \
-v "$(pwd)"/data:/data \
-e RSYNC_PASSWORD=password \
-e IRSYNC_INTERVAL=30 \
-e IRSYNC_FROM=rsync://[email protected]:873/data/"\
-e IRSYNC_TO=./data \
-e IRSYNC_DELETE=true \
cjimti/irsync
IRSYNC_INTERVAL=10 Start next interval 10 seconds after the last completion.IRSYNC_TIMEOUT=7200 Timeout rsync and start next interval if the time exceeds 7200 seconds.IRSYNC_FROM=./ rsync from locationIRSYNC_TO=./data rsync to locationIRSYNC_FLAGS=-pvrt` rsync flags (verbose is required)IRSYNC_DELETE=false resync --delete flag added if set to true.Interval rsync uses GORELEASER to build binaries and Docker containers.
Install GORELEASER with brew (MacOS):
brew install goreleaser/tap/goreleaser
Build without releasing:
goreleaser --skip-publish --rm-dist --skip-validate
git tag -a v1.4 -m "my version 1.4"git push origin v1.5GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-distContent type
Image
Digest
Size
4.7 MB
Last updated
over 8 years ago
docker pull cjimti/irsync