PHPackages                             jenwachter/php-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. jenwachter/php-rsync

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

jenwachter/php-rsync
====================

2.0.1(1y ago)23.6k↓50%2MITPHPPHP &gt;=8.1

Since Sep 12Pushed 1y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (8)Used By (0)

PHP Rsync
=========

[](#php-rsync)

A simple rsync library for PHP, able to perform local, remote, and [Akamai NetStorage](https://techdocs.akamai.com/netstorage/docs/use-rsync) syncs. Note that this library is not all-inclusive of everything that can be done with the rsync command.

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)

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

[](#requirements)

- PHP &gt;= 8.0

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

[](#installation)

To install the library, you will need to use [Composer](https://getcomposer.org/download/) in your project.

```
composer require jenwachter/php-rsync
```

Usage
-----

[](#usage)

### Create a connection

[](#create-a-connection)

To start using the library, you must first create a connection. This connection is then passed to the `Rsync` class.

```
$connection = new PhpRsync\Connection($type);
$rsync = new Rsync($connection);
```

There are three types of connections:

### Local

[](#local)

Use this type of connection when the source and destination are on the same machine. Example: transferring files from one directory to another on your local machine.

```
$local = new PhpRsync\Connection(
  'local',
  '/path/to/destination/root/dir'
);

$rsync = new Rsync($local);
```

### Remote

[](#remote)

Use this type of connection when the source and destination are different machines. Example: transferring files from your local machine to a remote machine.

```
$remote = new PhpRsync\Connection(
  'remote',
  '/path/to/destination/root/dir',
  'remote.host.com',
  'username',
  ['ssh_key' => '/path/to/ssh/key']
);

$rsync = new Rsync($remote);
```

Alternatively, you can use a password for authentication by passing `['password' => 'your_password']` as the fifth parameter.

### Akamai

[](#akamai)

Use this type of connection when the destination is Akamai NetStorage. For details on how to connect to NetStorage, see the [NetStorage Rsync documentation](https://techdocs.akamai.com/netstorage/docs/use-rsync)

```
$akamai = new PhpRsync\Connection(
  'akamai',
  '/path/to/destination/root/dir',
  'cpcode.rsync.upload.akamai.com',
  'username',
  ['ssh_key' => '/path/to/ssh/key']
);

$rsync = new Rsync($akamai);
```

### Perform rsync transfers

[](#perform-rsync-transfers)

```
$options = [];

$rsync->run(
  '/path/to/source/dir',
  'relative/path/to/destination/dir',
  $options
);
```

#### Available options

[](#available-options)

- **archive**: Boolean. Adds `--archive` flag, if true. Default: true
- **compress**: Boolean. Adds `--compress` flag, if true. Default: true
- **cwd**: String. Changes the current working directory prior to running the `rsync` command. Default: null
- **delete**: Boolean. Adds `--delete` flag, if true. Default: false
- **dryrun**: Boolean. Adds `--dry-run` and `--verbose` flags, if true. Default: false
- **exclude**: Array|String. If a string is passed, adds `--exclude=""` flag. if an array of strings is passed, adds multiple `--exclude=""` flags. Default: null
- **include**: Array|String. If a string is passed, adds `--include=""` flag. if an array of strings is passed, adds multiple `--include=""` flags. Default: null
- **relative**: Boolean. Adds `--relative` flag, if true. Default: false

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~89 days

Recently: every ~105 days

Total

6

Last Release

530d ago

Major Versions

1.1.1 → 2.0.02024-02-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/11e1b915549459b87bab747538857fb810a047407ad1a0eeee929e23908d5490?d=identicon)[jenwachter](/maintainers/jenwachter)

---

Top Contributors

[![jenwachter](https://avatars.githubusercontent.com/u/1202305?v=4)](https://github.com/jenwachter "jenwachter (22 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ecotone/ecotone

Supporting you in building DDD, CQRS, Event Sourcing applications with ease.

558549.8k17](/packages/ecotone-ecotone)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[symfony/ai-platform

PHP library for interacting with AI platform provider.

51927.7k136](/packages/symfony-ai-platform)[symfony/ai-agent

PHP library for building agentic applications.

30536.7k44](/packages/symfony-ai-agent)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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