{"id":28405961,"url":"https://github.com/txn2/irsync","last_synced_at":"2025-08-16T22:33:11.864Z","repository":{"id":57593235,"uuid":"127704846","full_name":"txn2/irsync","owner":"txn2","description":"rsync on interval, via command line binary or docker container. Server and IOT builds for pull or push based device content management.","archived":false,"fork":false,"pushed_at":"2018-10-27T21:55:41.000Z","size":656,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-12T04:12:28.297Z","etag":null,"topics":["backup","configuration-management","content-management","data","devops","docker","docker-container","docker-image","go","golang","homebrew","interval","iot","iot-application","linux","macos","rsync","rsync-commandline","system-administration"],"latest_commit_sha":null,"homepage":"https://imti.co/raspberry-pi-rsync-interval/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/txn2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-02T05:03:54.000Z","updated_at":"2024-11-12T13:41:53.000Z","dependencies_parsed_at":"2022-09-12T15:32:14.951Z","dependency_job_id":null,"html_url":"https://github.com/txn2/irsync","commit_stats":null,"previous_names":["cjimti/irsync"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/txn2/irsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txn2%2Firsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txn2%2Firsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txn2%2Firsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txn2%2Firsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/txn2","download_url":"https://codeload.github.com/txn2/irsync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/txn2%2Firsync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270781196,"owners_count":24643804,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backup","configuration-management","content-management","data","devops","docker","docker-container","docker-image","go","golang","homebrew","interval","iot","iot-application","linux","macos","rsync","rsync-commandline","system-administration"],"created_at":"2025-06-01T22:09:39.668Z","updated_at":"2025-08-16T22:33:11.845Z","avatar_url":"https://github.com/txn2.png","language":"Go","readme":"[![irsync: interval rsync](irsync-mast.jpg)](https://github.com/txn2/irsync)\n\n[![irsync Release](https://img.shields.io/github/release/txn2/irsync.svg)](https://github.com/txn2/irsync/releases)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ftxn2%2Firsync.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Ftxn2%2Firsync?ref=badge_shield)\n[![Maintainability](https://api.codeclimate.com/v1/badges/17e7ef41f16a004d020f/maintainability)](https://codeclimate.com/github/txn2/irsync/maintainability)\n[![Go Report Card](https://goreportcard.com/badge/github.com/txn2/irsync)](https://goreportcard.com/report/github.com/txn2/irsync)\n\n# Interval [rsync]\n\nSource: https://github.com/txn2/irsync\n\nCommand line utility and [Docker] container for running [rsync] on an interval. rsync, synchronizes (one way) files between two sources, **irsync** wrapps [rsync] and runs it on a specified interval.\n\nAs a basic command-line utility, the only requirement is [rsync]. As a [Docker] container the conly requirement is [Docker]. The docker container size with all the requirements is only around 5 megs.\n\n## Background\n\nI wrote up a little background on the motivation behind **irsync** on my [imti.co] blog, [rSync Files on Interval](https://imti.co/raspberry-pi-rsync-interval/).\n\n\n## Demo\n\nSetup a quick demo using [Docker]s `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`.\n\n[Watch a 2 minute youtube video demoing the commands below](https://www.youtube.com/watch?v=gT_P2a-xpPw)\n\n**Setup and run demo (requires [Docker]):**\n\n```bash\n# create a source and dest directories (mounted from the docker-compose)\nmkdir -p ./data/source\nmkdir -p ./data/dest\n\n# make a couple of sample files\ntouch ./data/source/test1.txt\ntouch ./data/source/test2.txt\n\n# get the docker-compose.yml\ncurl https://raw.githubusercontent.com/txn2/irsync/master/docker-compose.yml \u003edocker-compose.yml\n\n# run docker-compose in the background (-d flag)\ndocker-compose up -d\n\n# view logs\ndocker-compose logs -f\n\n# drop some more files in the ./data/source directory\n# irsync is configured to check every 30 seconds in this demo.\n\n#### Cleanup\n\n# stop containers\ndocker-compose stop\n\n# remove containers\ndocker-compose rm\n\n```\n\n## Run on MacOS\n\n**Install**\n```bash\nbrew tap txn2/homebrew-tap\nbrew install irsync\n```\n\n**Update** (when new versions are released)\n```bash\nbrew upgrade irsync\n```\n\n**Run**\nPrints the rsync version every 5 seconds.\n```bash\nirsync --irsync-interval-seconds=5 --version \n```\n\nAdjust the interval to your requirement and add `rsync` flags as you normally would.\n\n## Run From Source\n\n#### Example #1 Local with interval defaults\n\n```bash\ngo run ./irsync.go -pvrt --exclude='custom' --exclude='special.txt' --delete ./data/source/ ./data/dest/\n```\n\n## Run From Container\n\n#### Example #1 Local\n\n```bash\ndocker run --rm -v \"$(pwd)\"/data:/data txn2/irsync \\\n    -pvrt --delete /data/source/ /data/dest/\n```\n\n#### Example #2 Local Every 10 Seconds\n\n```bash\ndocker run --rm -v \"$(pwd)\"/data:/data txn2/irsync \\\n    --irsync-interval-seconds=10 \\\n    -pvrt --delete /data/source/ /data/dest/\n```\n\n#### Example #3 Server to Local - Restart on Failure\n\n```bash\ndocker run -d --name irsync-demo --restart on-failure \\\n    -v \"$(pwd)\"/data:/data txn2/irsync \\\n    --irsync-interval-seconds=10 \\\n    -pvrt --delete /data/source/ /data/dest/\n```\n\n#### Example#4: Custom container\n\nCreate `Dockerfile`:\n```bash\nFROM txn2/irsync:2.0.0\nLABEL vendor=\"mk.imti.co\"\nLABEL co.imti.mk.source=\"https://github.com/txn2/irsync\"\n\n# if the rsync server requires a password\nENV RSYNC_PASSWORD=password\n\n# exampe: keep local synchronized with server\n# interval default: --irsync-interval-seconds=120\n# activity timout default: --irsync-timeout-seconds=7200\nCMD [\"-pvrt\", \"--modify-window=30\", \"--delete\", \"--exclude='fun'\", \"rsync://sync@mk.imti.co:873/data/\", \"/media\"]\n```\n\nBuild:\n\n```bash\ndocker build -t custom-sync .\n```\n\nRun:\n\n```bash\ndocker run -d --name custom-sync --restart on-failure \\\n    -v \"$(pwd)\"/data:/data custom-sync\n```\n\nLogs:\n\n```bash\ndocker logs -f custom-sync\n```\n\n## Environment Configuration\n\n- `RSYNC_PASSWORD=password` Use environment variable `RSYNC_PASSWORD` to keep from being prompted for a password for servers requiring authentication.\n\n## Development\n\n### Building and Releasing\n\nInterval [rsync] uses [GORELEASER] to build binaries and [Docker] containers.\n\n#### Test Release Steps\n\nInstall [GORELEASER] with [brew] (MacOS):\n```bash\nbrew install goreleaser/tap/goreleaser\n```\n\nBuild without releasing:\n```bash\ngoreleaser --skip-publish --rm-dist --skip-validate\n```\n\n#### Release Steps\n\n- Commit latest changes\n- [Tag] a version `git tag -a v2.0 -m \"Version 2.0\"`\n- Push tag `git push origin v2.0`\n- Run: `GITHUB_TOKEN=$GITHUB_TOKEN goreleaser --rm-dist`\n\n## Resources\n\n- [GORELEASER]\n- [Docker]\n- [rsync]\n- [homebrew]\n\n[homebrew]: https://brew.sh/\n[brew]: https://brew.sh/\n[GORELEASER]: https://goreleaser.com/\n[Docker]: https://www.docker.com/\n[rsync]: https://en.wikipedia.org/wiki/Rsync\n[Tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging\n[imti.co]: https://imti.co\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ftxn2%2Firsync.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ftxn2%2Firsync?ref=badge_large)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxn2%2Firsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftxn2%2Firsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftxn2%2Firsync/lists"}