Rsync beats FileZilla hands down


Eventually got round to replacing FileZilla with Rsync and it is fantastic :slight_smile: A single click now updates all local files to the server and takes about five seconds!

It is well worth taking the trouble to setup this method because it completely eliminates the need for FileZilla or other upload file transfer programs.

Rsync stands for “remote sync”, is a remote and local file synchronization tool. It uses an algorithm that minimizes the amount of data copied by only moving the portions of files that have changed.

A link on the localhost home page set $_GET['rsync'] which is tested and if true then Linux RSYNC :

  1. tests local files which need updating
  2. zips required files that want updating
  3. uploads, unzips and overwrites ONLY outdated files
  4. sets all server file permissions, time stamps, etc


Desktop: Linux Ubuntu 18.04 with SSH setup
Remote: Linux Ubuntu Server
Linux SSH: Setup
RSYNC: Setup


I created the following link on the home-page.php

// RSYNC PAGE LINK or Version
  $rsync = '<i class="flr fss"> &nbsp; Ver: 5.505 &nbsp; </i>';
    $rsync = '<a class="flr fss" href="?rsync"> rSync &nbsp; </a>';
  echo '<h5>' .$rsync .'</h5>';'


// COMMON TO ALL PAGES - mine is in the SuperClass
  $rsync = isset($_GET['rsync']) ? true : false;
  if(LOCALHOST && $rsync):
    $HERE   = '/var/www/EXAMPLE.COM/src_files/'; 
    $USER   = 'SSH_USER';  

    $tmp    = '/usr/bin/rsync -ratlz --rsh="/usr/bin/sshpass -p $PWORD ssh -o StrictHostKeyChecking=no -l $USER" $HERE $THERE';

	$ok = exec($tmp);


To prevent the SSH password from being entered every time I used the following:


So, what’s the usecase? Looks good for backups, but i prefer using GIT for deployment.

And why do you disable the security feature? It’s relatively easy to just create the keys on both sides and use encryption.


I develop websites locally and instead of using FileZilla for uploading to online have started to use Rsync which is a lot quicker.

I use the online files as my Github.

The security feature is disabled temporarily because I have yet to correctly set SSH… maybe tomorrow :slight_smile:


I use rsync as well, but I never overwrite the current website with new files, because while you’re uploading you’re in an intermediate state where files of the old version are mixed with files from the new version, and you can’t be sure at all what will happen when a request comes in at that time.

Instead I have a folder releases that contains releases of the website, and a symlink current that points to the currently active version:

For example:

/current # Symlink to releases/20190301-125432

Then when I upload a new site I create a new directory in releases, upload all files to it, and switch the symlink to it, so the entire changes as one atomical action.

An additional benefit here is that if there is something wrong with the current version you can just point the symlink to a previous release.


There are also tools to automate this, like Capistrano for Rails. I’m sure there’ll be sth similar for PHP.


*: As long as your situation is narrowly defined as ‘you have SFTP access to the remote server’, since this program uses that protocol.