{"id":34813715,"url":"https://github.com/fizzed/jsync","last_synced_at":"2026-04-05T13:31:18.626Z","repository":{"id":327820340,"uuid":"1103976630","full_name":"fizzed/jsync","owner":"fizzed","description":"Pure Java rsync-like library for local to/from remote ssh/sftp. Can be used programmatically or via the command-line. Works on all platforms including Windows!","archived":false,"fork":false,"pushed_at":"2025-12-06T00:21:47.000Z","size":2253,"stargazers_count":41,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-09T14:16:52.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fizzed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-25T15:29:23.000Z","updated_at":"2025-12-09T03:03:40.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fizzed/jsync","commit_stats":null,"previous_names":["fizzed/jsync"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/fizzed/jsync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizzed%2Fjsync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizzed%2Fjsync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizzed%2Fjsync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizzed%2Fjsync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fizzed","download_url":"https://codeload.github.com/fizzed/jsync/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fizzed%2Fjsync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31437927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T13:13:19.330Z","status":"ssl_error","status_checked_at":"2026-04-05T13:13:17.778Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-12-25T13:00:26.951Z","updated_at":"2026-04-05T13:31:18.619Z","avatar_url":"https://github.com/fizzed.png","language":"Java","funding_links":[],"categories":["网络编程"],"sub_categories":["Spring Cloud框架"],"readme":"# Jsync by Fizzed\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.fizzed/jsync?style=flat-square)](https://mvnrepository.com/artifact/com.fizzed/jsync)\n\n## Automated Testing\n\nThe following Java versions and platforms are tested using GitHub workflows:\n\n[![Java 8](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java8.yaml?branch=master\u0026label=Java%208\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java8.yaml)\n[![Java 11](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java11.yaml?branch=master\u0026label=Java%2011\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java11.yaml)\n[![Java 17](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java17.yaml?branch=master\u0026label=Java%2017\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java17.yaml)\n[![Java 21](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java21.yaml?branch=master\u0026label=Java%2021\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java21.yaml)\n[![Java 25](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java25.yaml?branch=master\u0026label=Java%2025\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java25.yaml)\n\n[![Linux x64](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/linux-java8.yaml?branch=master\u0026label=Linux%20x64\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/linux-java8.yaml)\n[![MacOS arm64](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/macos-arm64.yaml?branch=master\u0026label=MacOS%20arm64\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/macos-arm64.yaml)\n[![Windows x64](https://img.shields.io/github/actions/workflow/status/fizzed/jsync/windows-x64.yaml?branch=master\u0026label=Windows%20x64\u0026style=flat-square)](https://github.com/fizzed/jsync/actions/workflows/windows-x64.yaml)\n\nThe following platforms are tested using the [Fizzed, Inc.](http://fizzed.com) build system:\n\n[![Alpine x64](https://img.shields.io/badge/Alpine_x64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![Alpine arm64](https://img.shields.io/badge/Alpine_arm64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![Alpine riscv64](https://img.shields.io/badge/Alpine_riscv64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![FreeBSD x64](https://img.shields.io/badge/FreeBSD_x64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![FreeBSD arm64](https://img.shields.io/badge/FreeBSD_arm64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![Linux arm64](https://img.shields.io/badge/Linux_arm64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![Linux riscv64](https://img.shields.io/badge/Linux_riscv64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![MacOS x64](https://img.shields.io/badge/MacOS_x64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![NetBSD x64](https://img.shields.io/badge/MacOS_x64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![OpenBSD x64](https://img.shields.io/badge/OpenBSD_x64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![OpenBSD arm64](https://img.shields.io/badge/OpenBSD_arm64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n[![Windows arm64](https://img.shields.io/badge/Windows_arm64-passing-brightgreen?style=flat-square)](buildx-results.txt)\n\n## Overview\n\nPure Java library (8, 11, 17, 21, 25, etc.) for providing rsync-like efficient file synchronization between two directories\nor files either locally or remotely via SSH/SFTP. Requires no native dependencies, works on all major platforms including Windows,\nand requires no special executables present on the remote system.\n\n## Features\n - Supports all platforms that Java can run on, including Windows\n - Diff-based Syncing: Only transfers files that have changed (based on size, modification time, or checksum).\n - Local: Sync between local directories.\n - SSH/SFTP: Sync between local and remote servers (via SSH/SFTP).\n - Zero-Dependency Core: The core logic is separated from protocol implementations to keep the footprint small.\n - Builder API: Fluent, easy-to-use Java API for configuring sync jobs.\n - Supports syncing file and directory permissions\n - Does NOT require rsync to be installed on either system, uses SFTP for file operations on the remote system,\nalong with using SSH for checksums if needed.\n - Leverages the excellent [Jsch](https://github.com/mwiede/jsch) library for SSH/SFTP support (but designed to pluggable\nand support other SSH/SFTP implementations in the future)\n\n## Command-Line Tool / Example\n\nThis library is optimized primarily for programmatic use, but if you'd like to simply use it from the command-line,\nor to quickly give it a try, we suggest trying it out from within the [Blaze Script System](https://github.com/fizzed/blaze)\nwhich has a built-in Jsync plugin with sophisticated SSH session handling (such as supporting ~/.ssh/config, ssh agents, etc.)\nTo quickly give it a try, you can run the following commands:\n\n```shell\ngit clone https://github.com/fizzed/blaze.git\ncd blaze\njava -jar blaze.jar examples/jsync.java --from ~/example.iso --to bmh-build-x64-freebsd15-1:. --mode nest\n```\n\nNot all options are available from the command-line, but many of the most common ones are supported. If there is enough\ndemand, we may add a standalone command-line tool in the future.\n\n## Usage\n\nPublished to maven central use the following for core and local-only syncing:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fizzed\u003c/groupId\u003e\n    \u003cartifactId\u003ejsync-engine\u003c/artifactId\u003e\n    \u003cversion\u003e1.5.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nIf you'd like to use SSH/SFTP syncing, you'll need to add the following dependency as well:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.fizzed\u003c/groupId\u003e\n    \u003cartifactId\u003ejsync-sftp\u003c/artifactId\u003e\n    \u003cversion\u003e1.5.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo sync between two directories locally, here is an example:\n\n```java\nimport com.fizzed.jsync.vfs.VirtualVolume;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport java.nio.file.Paths;\nimport static com.fizzed.jsync.vfs.LocalVirtualVolume.localVolume;\n\npublic class LocalToLocalDemo {\n    static private final Logger log = LoggerFactory.getLogger(LocalToLocalDemo.class);\n\n    static public void main(String[] args) throws Exception {\n\n        final VirtualVolume source = localVolume(Paths.get(\"example/source\"));\n        final VirtualVolume target = localVolume(Paths.get(\"example/target\"));\n\n        final JsyncResult result = new JsyncEngine()\n            .setDelete(true)\n            .sync(source, target, JsyncMode.MERGE);\n    }\n\n}\n```\n\nTo sync between a local and remote directory, here is an example. Note that this includes more options to control\nhow the sync is performed, such as telling the engine to create parent directories if they don't exist, and to force\nthe sync if the target directory has \"file type\" mismatches (i.e. a file exists on the target with the same name as a\ndirectory on the source, or vice versa), and to ignore syncing the local '.git' directory.\n\n```java\nimport com.fizzed.jsync.vfs.VirtualVolume;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport java.nio.file.Paths;\nimport static com.fizzed.jsync.sftp.SftpVirtualVolume.sftpVolume;\nimport static com.fizzed.jsync.vfs.LocalVirtualVolume.localVolume;\n\npublic class LocalToRemoteDemo {\n    static private final Logger log = LoggerFactory.getLogger(LocalToRemoteDemo.class);\n\n    static public void main(String[] args) throws Exception {\n\n        final VirtualVolume source = localVolume(Paths.get(\"example/source\"));\n        final VirtualVolume target = sftpVolume(\"target-host\", \"remote-dir/target\");\n\n        final JsyncResult result = new JsyncEngine()\n            .setDelete(true)\n            .setParents(true)\n            .setForce(true)\n            .addIgnore(\".git\")\n            .sync(source, target, JsyncMode.MERGE);\n    }\n\n}\n```\n\nThe sftp module provides fairly basic support for SSH configuration with just a hostname. Ideally, you'd provide your\nown Jsch SSH session to your `sftpVolume` call, where you can then provide your own custom SSH configuration. For example:\n\n```java\nimport com.fizzed.jsync.vfs.VirtualVolume;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport java.nio.file.Paths;\nimport static com.fizzed.jsync.sftp.SftpVirtualVolume.sftpVolume;\nimport static com.fizzed.jsync.vfs.LocalVirtualVolume.localVolume;\n\npublic class LocalToRemoteDemo {\n    static private final Logger log = LoggerFactory.getLogger(LocalToRemoteDemo.class);\n\n    static public void main(String[] args) throws Exception {\n\n        // create a jsch session with custom configuration\n        final com.jcraft.jsch.Session ssh = createMyOwnSshSession();\n        \n        final VirtualVolume source = localVolume(Paths.get(\"example/source\"));\n        final VirtualVolume target = sftpVolume(ssh, \"remote-dir/target\");\n\n        final JsyncResult result = new JsyncEngine()\n            .sync(source, target, JsyncMode.MERGE);\n    }\n\n}\n```\n\nIf you want more sophisticated SSH sessions automatically handled by this Jsync engine, you should look at using\nthe [Blaze Script System](https://github.com/fizzed/blaze), which has a built-in Jsync plugin that supports SSH sessions with sophisticated configuration\n(such as ~/.ssh/config, ssh agents, etc.).\n\n## Sponsorship \u0026 Support\n\n![](https://cdn.fizzed.com/github/fizzed-logo-100.png)\n\nProject by [Fizzed, Inc.](http://fizzed.com) (Follow on X: [@fizzed_inc](https://x.com/fizzed_inc))\n\n**Developing and maintaining opensource projects requires significant time.** If you find this project useful or need\ncommercial support, we'd love to chat. Drop us an email at [ping@fizzed.com](mailto:ping@fizzed.com)\n\nProject sponsors may include the following benefits:\n\n- Priority support (outside of Github)\n- Feature development \u0026 roadmap\n- Priority bug fixes\n- Privately hosted continuous integration tests for their unique edge or use cases\n\n## License\n\nCopyright (C) 2025+ Fizzed, Inc.\n\nThis work is licensed under the Apache License, Version 2.0. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffizzed%2Fjsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffizzed%2Fjsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffizzed%2Fjsync/lists"}