xobotyi / Rsync
Licence: mit
rsync dependency-free wrapper library for PHP7.1+
Stars: ✭ 82
Labels
Projects that are alternatives of or similar to Rsync
Linux Timemachine
Rsync-based OSX-like time machine for Linux, MacOS and BSD for atomic and resumable local and remote backups
Stars: ✭ 358 (+336.59%)
Mutual labels: rsync
Gulp Tutorial
Code examples for my Gulp.js tutorial series
Stars: ✭ 383 (+367.07%)
Mutual labels: rsync
Rdiff Backup
Reverse differential backup tool, over a network or locally.
Stars: ✭ 510 (+521.95%)
Mutual labels: rsync
Websync
websync is intended to be an rsync manager, where rsync tasks can be added, scheduled and maintained in a sane manner.
Stars: ✭ 432 (+426.83%)
Mutual labels: rsync
Go Sync
gosync is a library for Golang styled around zsync / rsync, written with the intent that it enables efficient differential file transfer in a number of ways. NB: I am unable to contribute to this at the moment
Stars: ✭ 494 (+502.44%)
Mutual labels: rsync
Ksync
Sync files between your local system and a kubernetes cluster.
Stars: ✭ 1,005 (+1125.61%)
Mutual labels: rsync
Mirrorbits
Mirrorbits is a geographical download redirector written in Go for distributing files efficiently across a set of mirrors.
Stars: ✭ 365 (+345.12%)
Mutual labels: rsync
Rsync
In the process of being transitioned to a node.js action.
Stars: ✭ 53 (-35.37%)
Mutual labels: rsync
Gsync
gSync is an rsync based library for sending delta updates of files to a remote server.
Stars: ✭ 344 (+319.51%)
Mutual labels: rsync
Photos Sync
Sync OS X Photos to Anywhere (NAS, Dropbox, Amazon S3 or Glacier, Backblaze B2)
Stars: ✭ 29 (-64.63%)
Mutual labels: rsync
Hassio Addons
The repository for my Home Assistant Supervisor Add-ons.
Stars: ✭ 71 (-13.41%)
Mutual labels: rsync
Rsync Deployments
GitHub Action for deploying code via rsync over ssh
Stars: ✭ 59 (-28.05%)
Mutual labels: rsync
Heroku Google Drive
Remote Google Drive client on Heroku using Rclone and Aria2
Stars: ✭ 44 (-46.34%)
Mutual labels: rsync
Rsync
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?
- It is small and fully covered with tests
- It is well documented
- I'm eating my own sweet pie=)
- Supports whole bunch of parameters and options of rsync and ssh
- Easy to use
- Works on Windows (ofcourse id you installed ssh and rsync clients for Windows)
Requirements
- PHP 7.1+
- PHP config
variables_order
must containE
, 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
Install with composer
composer require xobotyi/rsync
Docs
The code is well documented, for methods and parameters descriptions see the sources.
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', '[email protected]:/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', '[email protected]:/abs/path/to/destination');
echo '/new/path/to/source ' . ($rsync->getExitCode() === 0 ? 'successfully synchronized with remote.' : 'not synchronised due to errors.') . "\n";
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].