PHPackages                             xobotyi/rsync - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xobotyi/rsync

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xobotyi/rsync
=============

rsync wrapper library for php

v1.0.3(7y ago)9732.3k—10%6[1 issues](https://github.com/xobotyi/rsync/issues)1MITPHPPHP &gt;=7.1CI failing

Since Apr 20Pushed 5y ago8 watchersCompare

[ Source](https://github.com/xobotyi/rsync)[ Packagist](https://packagist.org/packages/xobotyi/rsync)[ Docs](https://github.com/xobotyi/rsync)[ RSS](/packages/xobotyi-rsync/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (6)Used By (1)

Rsync
=====

[](#rsync)

 [ ![License](https://camo.githubusercontent.com/ddb6072452b8f1fe823327c91422a21b4abc7ecd5802e4fa13b03da3b45e1da4/68747470733a2f2f706f7365722e707567782e6f72672f786f626f7479692f7273796e632f6c6963656e7365) ](https://packagist.org/packages/xobotyi/rsync) [ ![PHP 7 ready](https://camo.githubusercontent.com/cee1c0d25fad082a9409707d09add33d80509f386743fce0f6c1108f1992e5de/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f786f626f7479692f7273796e632f62616467652e737667) ](https://packagist.org/packages/xobotyi/rsync) [ ![Build Status](https://camo.githubusercontent.com/ce5a73a304aaf7a32ba97f74b80b0416821e3b7cc266ee5ed71d467b107e4820/68747470733a2f2f7472617669732d63692e6f72672f786f626f7479692f7273796e632e7376673f6272616e63683d6d6173746572) ](https://travis-ci.org/xobotyi/rsync) [ ![Codacy Grade](https://camo.githubusercontent.com/a608c355c45a901b603bd73406506aba3601233be8ab88e28058bab80dde383e/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6261376436336366353438343466353438306436623361353863313533346137) ](https://www.codacy.com/app/xobotyi/rsync) [ ![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7ce32a7a0d1febf0750c50052c7ff9625388831f65ec2faabddb2dc44d31e91/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f786f626f7479692f7273796e632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572) ](https://scrutinizer-ci.com/g/xobotyi/rsync/) [ ![Codacy Coverage](https://camo.githubusercontent.com/f76a576a32d6ca6f19b95f69fadd4322106b99074523d61b780649f73e497ec4/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f6261376436336366353438343466353438306436623361353863313533346137) ](https://www.codacy.com/app/xobotyi/rsync) [ ![Latest Stable Version](https://camo.githubusercontent.com/6a2c557b464f422595c964404c11cd0db9d25b1aa927b2dad36370739750eb07/68747470733a2f2f706f7365722e707567782e6f72672f786f626f7479692f7273796e632f762f737461626c65) ](https://packagist.org/packages/xobotyi/rsync) [ ![Total Downloads](https://camo.githubusercontent.com/087539f2bae1ecfba2e4faf30429aebfad8e5b3517d1d8d8b91b60760b7e0cc3/68747470733a2f2f706f7365722e707567782e6f72672f786f626f7479692f7273796e632f646f776e6c6f616473) ](https://packagist.org/packages/xobotyi/rsync)

About
-----

[](#about)

Rsync is a pure PHP 7.1+ dependency-free wrapper for rsync client. It provides you a simple way to abstract from command line control rsync right from php. Library uses PSR-4 autoloader standard and always has 100% tests coverage.
There is no need to tell about rsync, except the fact that php doesn't has any faster or equal built-in way to upload files to remote server.

Library supports whole bunch of options and parameters implemented in rsync client version 3.1.2

Why Rsync?
----------

[](#why-rsync)

1. It is small and fully covered with tests
2. It is well documented
3. I'm eating my own sweet pie=)
4. Supports whole bunch of parameters and options of rsync and ssh
5. Easy to use
6. Works on Windows (ofcourse id you installed ssh and rsync clients for Windows)

Requirements
------------

[](#requirements)

- [PHP](//php.net/) 7.1+
- PHP config `variables_order` must contain `E`, 4ex: `variables_order=EGPCS`.
    Otherwise you will have to manually specify absolute path to rsync and ssh binaries (at least on Windows)
- rsync client 3.1.2 +

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

[](#installation)

Install with composer

```
composer require xobotyi/rsync
```

Docs
----

[](#docs)

The code is well documented, for methods and parameters descriptions see the sources.

Usage
-----

[](#usage)

*Simplest:*

```
use xobotyi\rsync\Rsync;

$rsync = new Rsync();
$rsync->sync('/path/to/source', '/path/to/destination');
```

*If you need SSH:*

```
use xobotyi\rsync\Rsync;
use xobotyi\rsync\SSH;

$rsync = new Rsync([
                       Rsync::CONF_CWD        => __DIR__,
                       Rsync::CONF_EXECUTABLE => '/even/alternative/executable/rsync.exe',
                       Rsync::CONF_SSH        => [
                           SSH::CONF_EXECUTABLE => '/even/alternative/executable/ssh.exe',
                           SSH::CONF_OPTIONS    => [
                               SSH::OPT_OPTION              => ['BatchMode=yes', 'StrictHostKeyChecking=no'],
                               SSH::OPT_IDENTIFICATION_FILE => './path/to/ident',
                               SSH::OPT_PORT                => 2222,
                           ],
                       ],
                   ]);
$rsync->sync('./relative/path/to/source', 'user@some.remote.lan:/abs/path/to/destination');
echo './relative/path/to/source ' . ($rsync->getExitCode() === 0 ? 'successfully synchronized with remote.' : 'not synchronised due to errors.') . "\n";

$rsync->setExecutable('ssh')
      ->setOption(SSH::OPT_OPTION, false)// 'false' value turns off the options
      ->setOptions([
                       SSH::OPT_IDENTIFICATION_FILE => './new/path/to/ident',
                       SSH::OPT_PORT                => 22,
                   ]);
$rsync->sync('/new/path/to/source', 'user@some.remote.lan:/abs/path/to/destination');
echo '/new/path/to/source ' . ($rsync->getExitCode() === 0 ? 'successfully synchronized with remote.' : 'not synchronised due to errors.') . "\n";
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.9% 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 ~23 days

Total

5

Last Release

2860d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6178739?v=4)[Anton Zinovyev](/maintainers/xobotyi)[@xobotyi](https://github.com/xobotyi)

---

Top Contributors

[![xobotyi](https://avatars.githubusercontent.com/u/6178739?v=4)](https://github.com/xobotyi "xobotyi (47 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![russtaylor](https://avatars.githubusercontent.com/u/729694?v=4)](https://github.com/russtaylor "russtaylor (1 commits)")

---

Tags

phprsyncrsync-wrapperphprsyncresync-wrapper

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xobotyi-rsync/health.svg)

```
[![Health](https://phpackages.com/badges/xobotyi-rsync/health.svg)](https://phpackages.com/packages/xobotyi-rsync)
```

###  Alternatives

[imanghafoori/laravel-anypass

A minimal yet powerful package to help you in development.

21421.6k](/packages/imanghafoori-laravel-anypass)

PHPackages © 2026

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