PHPackages                             kmi/file-sync-tool - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. kmi/file-sync-tool

ActiveProject[File &amp; Storage](/categories/file-storage)

kmi/file-sync-tool
==================

Python script to synchronize files from and to client systems.

0.4.9(1y ago)2121MITPython

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jackd248/file-sync-tool)[ Packagist](https://packagist.org/packages/kmi/file-sync-tool)[ Docs](https://github.com/jackd248/file-sync-tool)[ RSS](/packages/kmi-file-sync-tool/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (14)Used By (0)

file sync tool
==============

[](#file-sync-tool)

[![PyPI - Python Version](https://camo.githubusercontent.com/82bceed548f6f102fd4345b6006a104d88a8959a9494b3ccb1ae7c85e637c15c/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f66696c655f73796e635f746f6f6c2d6b6d69)](https://camo.githubusercontent.com/82bceed548f6f102fd4345b6006a104d88a8959a9494b3ccb1ae7c85e637c15c/68747470733a2f2f696d672e736869656c64732e696f2f707970692f707976657273696f6e732f66696c655f73796e635f746f6f6c2d6b6d69)[![PyPI](https://camo.githubusercontent.com/e47c2375b2552e39327678368c86d0af93e49bbf8df43d72df3c74b331d2f974/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f66696c655f73796e635f746f6f6c2d6b6d69)](https://camo.githubusercontent.com/e47c2375b2552e39327678368c86d0af93e49bbf8df43d72df3c74b331d2f974/68747470733a2f2f696d672e736869656c64732e696f2f707970692f762f66696c655f73796e635f746f6f6c2d6b6d69)[![Pepy Total Downloads](https://camo.githubusercontent.com/bf41797feb76915b347ffa892b2953b655459b4e443c2ead0ac3ecb78bb9a118/68747470733a2f2f696d672e736869656c64732e696f2f706570792f64742f66696c652d73796e632d746f6f6c2d6b6d69)](https://camo.githubusercontent.com/bf41797feb76915b347ffa892b2953b655459b4e443c2ead0ac3ecb78bb9a118/68747470733a2f2f696d672e736869656c64732e696f2f706570792f64742f66696c652d73796e632d746f6f6c2d6b6d69)[![PyPI - Downloads](https://camo.githubusercontent.com/e6e9b6ac963f34ed98d5c0865447d1d755d5d413c00012b435eaf56981bfc497/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f66696c652d73796e632d746f6f6c2d6b6d69)](https://camo.githubusercontent.com/e6e9b6ac963f34ed98d5c0865447d1d755d5d413c00012b435eaf56981bfc497/68747470733a2f2f696d672e736869656c64732e696f2f707970692f646d2f66696c652d73796e632d746f6f6c2d6b6d69)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/8037cf33fe5d480b2b2ae6bd14413282fe70fd9efcc39525beb721ebbddf83dc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a61636b643234382f66696c652d73796e632d746f6f6c2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jackd248/file-sync-tool/?branch=master)[![Build Status](https://camo.githubusercontent.com/3de93e4d6e7523a4bc4b6cfcfe906ff332e86274be237a170b68f0fd6481c6c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6a61636b643234382f66696c652d73796e632d746f6f6c2f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/jackd248/file-sync-tool/build-status/master)

Python script to synchronize files from an origin to a target system using [rsync](https://linux.die.net/man/1/rsync).

This tool is an addon of the [db-sync-tool](https://github.com/jackd248/db-sync-tool).

[![Example receiver](docs/images/file-sync-tool-example-receiver.gif)](docs/images/file-sync-tool-example-receiver.gif)

Installation
------------

[](#installation)

### Prerequisite

[](#prerequisite)

The script needs [python](https://python.org/) **3.5** or higher. It is necessary for some additional functionalities to have [pip](https://pypi.org/project/pip/) installed on your local machine.

### pip

[](#pip)

The library can be installed from [PyPI](https://pypi.org/project/file-sync-tool-kmi/):

```
$ pip3 install file-sync-tool-kmi
```

### composer

[](#composer)

The script is also available via [packagist.org](https://packagist.org/packages/kmi/file-sync-tool) using composer:

```
$ composer require kmi/file-sync-tool
```

Additionally install the python requirements via the following pip command:

```
$ pip3 install -e vendor/kmi/file-sync-tool/
```

Configuration
-------------

[](#configuration)

You can configure the script with [shell arguments](#shell-arguments) or using a separate configuration file.

### Configuration File

[](#configuration-file)

The `config.json` contains important information about the origin and the target system.

Example structure of `config.json` in receiver mode :

```
{
  "target": {},
  "origin": {
    "host": "ssh_host",
    "user": "ssh_user"
  },
  "files": {
    "config": [
      {
        "origin": "/var/www/html/files/",
        "target": "/var/www/html/files/",
        "exclude": [
          "*.log"
        ]
      }
    ]
  }
}
```

### Documentation

[](#documentation)

Extend the `config.json` with a `files` section containing multiple transfer entries within the `config`entry. Therefore you have to specify the `origin` source path as well as the `target` destination path of the file sync. Additionally define the rsync `exclude`s for this specific transfer.

In the `config` entry you can also define additional rsync `option`s as a list overwriting the default options.

For further information see the documentation of the [db-sync-tool](https://github.com/jackd248/db-sync-tool).

Usage
-----

[](#usage)

### Command line

[](#command-line)

Run the python script via command line.

Installed via [pip](#install-pip):

```
$ file_sync_tool
```

Installed via [composer](#install-composer):

```
$ python3 vendor/kmi/file-sync-tool/file_sync_tool
```

#### Shell arguments

[](#shell-arguments)

```
usage: file_sync_tool [-h] [-f CONFIG_FILE] [-v] [-m] [-o HOST_FILE]
                      [-th TARGET_HOST] [-tu TARGET_USER]
                      [-tpw TARGET_PASSWORD] [-tk TARGET_KEY]
                      [-tpo TARGET_PORT] [-oh ORIGIN_HOST] [-ou ORIGIN_USER]
                      [-opw ORIGIN_PASSWORD] [-ok ORIGIN_KEY]
                      [-opo ORIGIN_PORT] [-fo FILES_ORIGIN] [-ft FILES_TARGET]
                      [-fe FILES_EXCLUDE] [-fop FILES_OPTION]

A tool for automatic file synchronization from and to host systems.

optional arguments:
  -h, --help            show this help message and exit
  -f CONFIG_FILE, --config-file CONFIG_FILE
                        Path to configuration file
  -v, --verbose         Enable extended console output
  -m, --mute            Mute console output
  -o HOST_FILE, --host-file HOST_FILE
                        Using an additional hosts file for merging hosts
                        information with the configuration file
  -th TARGET_HOST, --target-host TARGET_HOST
                        SSH host to target system
  -tu TARGET_USER, --target-user TARGET_USER
                        SSH user for target system
  -tpw TARGET_PASSWORD, --target-password TARGET_PASSWORD
                        SSH password for target system
  -tk TARGET_KEY, --target-key TARGET_KEY
                        File path to SSH key for target system
  -tpo TARGET_PORT, --target-port TARGET_PORT
                        SSH port for target system
  -oh ORIGIN_HOST, --origin-host ORIGIN_HOST
                        SSH host to origin system
  -ou ORIGIN_USER, --origin-user ORIGIN_USER
                        SSH user for origin system
  -opw ORIGIN_PASSWORD, --origin-password ORIGIN_PASSWORD
                        SSH password for origin system
  -ok ORIGIN_KEY, --origin-key ORIGIN_KEY
                        File path to SSH key for origin system
  -opo ORIGIN_PORT, --origin-port ORIGIN_PORT
                        SSH port for origin system
  -fo FILES_ORIGIN, --files-origin FILES_ORIGIN
                        File path for origin source of file sync
  -ft FILES_TARGET, --files-target FILES_TARGET
                        File path for target destination of file sync
  -fe FILES_EXCLUDE, --files-exclude FILES_EXCLUDE
                        Excludes for file sync
  -fop FILES_OPTION, --files-option FILES_OPTION
                        Additional rsync options
```

If you haven't declare a path to a SSH key, during the script execution you are requested to enter the SSH password for the given user in the shell argument or the `config.json` to enable a SSH connection for the remote system.

### Import

[](#import)

You can import the python package and use them inside your project:

```
from file_sync_tool import sync

if __name__ == "__main__":
    sync.Sync(config={}, args*)
```

Release Guide
-------------

[](#release-guide)

A detailed guide is available to release a new version. See [here](docs/RELEASE.md).

Tests
-----

[](#tests)

A docker container set up is available for testing purpose. See [here](tests/README.md).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance47

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~130 days

Recently: every ~327 days

Total

13

Last Release

395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11557705846f24da32a0e6e75c460db505c1b847f081ddaa3d27f3ea27f4097b?d=identicon)[konradmichalik](/maintainers/konradmichalik)

---

Top Contributors

[![konradmichalik](https://avatars.githubusercontent.com/u/4558190?v=4)](https://github.com/konradmichalik "konradmichalik (1 commits)")[![tgaertner](https://avatars.githubusercontent.com/u/2931506?v=4)](https://github.com/tgaertner "tgaertner (1 commits)")

---

Tags

filesyncpythonpython3rsyncsyncsynchronizationfilessyncrsyncsynchronisation

### Embed Badge

![Health badge](/badges/kmi-file-sync-tool/health.svg)

```
[![Health](https://phpackages.com/badges/kmi-file-sync-tool/health.svg)](https://phpackages.com/packages/kmi-file-sync-tool)
```

###  Alternatives

[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.1k](/packages/league-flysystem)[league/flysystem-aws-s3-v3

AWS S3 filesystem adapter for Flysystem.

1.6k263.6M788](/packages/league-flysystem-aws-s3-v3)[league/flysystem-local

Local filesystem adapter for Flysystem.

226231.8M39](/packages/league-flysystem-local)[mikehaertl/php-tmpfile

A convenience class for temporary files

9729.7M20](/packages/mikehaertl-php-tmpfile)[league/flysystem-memory

In-memory filesystem adapter for Flysystem.

8533.6M194](/packages/league-flysystem-memory)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
