{"id":23530133,"url":"https://github.com/wzdnzd/bidirectional-sync","last_synced_at":"2025-05-14T12:33:35.977Z","repository":{"id":108017900,"uuid":"180967945","full_name":"wzdnzd/bidirectional-sync","owner":"wzdnzd","description":"Near real-time bi-directional synchronization tool base on lsyncd","archived":false,"fork":false,"pushed_at":"2019-04-15T09:42:07.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-17T03:28:52.992Z","etag":null,"topics":["backup","lsyncd","lua","rsync","synchronization"],"latest_commit_sha":null,"homepage":"https://github.com/wzdnzd/bidirectional-sync","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wzdnzd.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-12T08:45:12.000Z","updated_at":"2019-06-04T07:44:08.000Z","dependencies_parsed_at":"2023-05-01T02:32:07.607Z","dependency_job_id":null,"html_url":"https://github.com/wzdnzd/bidirectional-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzdnzd%2Fbidirectional-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzdnzd%2Fbidirectional-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzdnzd%2Fbidirectional-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzdnzd%2Fbidirectional-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wzdnzd","download_url":"https://codeload.github.com/wzdnzd/bidirectional-sync/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254142295,"owners_count":22021498,"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":["backup","lsyncd","lua","rsync","synchronization"],"created_at":"2024-12-25T21:15:44.956Z","updated_at":"2025-05-14T12:33:35.965Z","avatar_url":"https://github.com/wzdnzd.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Bi-Directional-Sync\n\n\u003e Note: \n\u003e * requires rsync \u003e= 3.1 on all source and target machines\n\nReal-time bi-directional synchronization tools between two data centers base on [lsyncd](https://github.com/axkibe/lsyncd). The sync direction control by DNS from master to slave.\n\n### Install Packages\n- [lsyncd](https://centos.pkgs.org/7/epel-x86_64/lsyncd-2.2.2-1.el7.x86_64.rpm.html)\n- [lua-socket](https://centos.pkgs.org/7/epel-x86_64/lua-socket-3.0-0.17.rc1.el7.x86_64.rpm.html)\n```bash\nyum install -y rsync\n\nrpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/lsyncd-2.2.2-1.el7.x86_64.rpm\nrpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/l/lua-socket-3.0-0.17.rc1.el7.x86_64.rpm \n```\n\n### Clone and Config\n\u003e Note: Use dos2unix reformat all files\n```bash\nvim /etc/lsyncd/config.json\n```\n\u003e Params:\n\u003e * host: target server \n\u003e * delete: whether to allow deletion when synchronizing\n\u003e * script: the path of shell script\n\u003e * excludeFrom: list of files that need to be excluded\n\u003e * port: ssh port\n\u003e * bwlimit: bandwidth limit\n\u003e * ...\n\n### Access without Requiring a Password\n```bash\nssh-keygen -t rsa\nssh-copy-id root@target\n```\n\n### Execute Lsyncd\n+ start with utils/lsyncd-cli.sh\n```bash\n./utils/lsyncd-cli.sh start\n```\n+ start with systemctl\n```bash\n# modify 'LSYNCD_OPTIONS' point to the conf/bisync.conf.lua \nvim /etc/sysconfig/lsyncd\n\n# enable auto startup when boosting\nsystemctl enable lsyncd\n\n# start\nsystemctl start lsyncd\n```\n\n### Reference\n+ [lsyncd实时同步搭建指南](http://seanlook.com/2015/05/06/lsyncd-synchronize-realtime/)\n+ [lsyncd](http://axkibe.github.io/lsyncd/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzdnzd%2Fbidirectional-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwzdnzd%2Fbidirectional-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzdnzd%2Fbidirectional-sync/lists"}