I have access to a webserver (a generic cheap PHP host) which has a bunch of smaller files that I want to take backups of. I can access with FTP but this is very slow. I can copy the files with scp, but one has to manually compress first, since the -C argument compresses each file, not all files, before sending. Ideally, I would just like to use rsync like normal. The server admin told me they would not install it. Is it possible to install this without access to apt or sudo as a portable binary?

I found the rsync binary for Ubuntu at https://download.samba.org/pub/rsync/binaries/ubuntu-20.04-x86_64/ (via https://rsync.samba.org/download.html). After setting chmod +x, I get this error:

[user@server]$ ./rsync
./rsync: error while loading shared libraries: libxxhash.so.0: cannot open shared object file: No such file or directory

Is there a clever way to acquire the missing library files all at once?

The server appears to be running Red Hat:

[user@server]$ cat /proc/version 
Linux version 3.10.0-962.3.2.lve1.5.49.el7.x86_64 (mockbuild@buildfarm03.cloudlinux.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Thu Mar 4 05:39:46 EST 2021

I don't see a precompiled version of rsync for this distro. What to do here? I cannot compile things on the server due to lacking libraries (very likely).


berndbausch asks in comments about the result of ldd rsync, which should show the required libraries:

linux-vdso.so.1 => (0x00007ffe589a3000)
libacl.so.1 => /lib64/libacl.so.1 (0x00007f6a681a5000) 
libz.so.1 => /lib64/libz.so.1 (0x00007f6a67f8f000) 
libpopt.so.0 => /lib64/libpopt.so.0 (0x00007f6a67d85000) 
liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f6a67b76000) 
libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f6a6789d000) 
libxxhash.so.0 => not found 
libcrypto.so.1.1 => not found 
libc.so.6 => /lib64/libc.so.6 (0x00007f6a674cf000) 
libattr.so.1 => /lib64/libattr.so.1 (0x00007f6a672ca000) 
/lib64/ld-linux-x86-64.so.2 (0x00007f6a683ae000)

So it appears there are only 2 missing ones.

Rsync from local machine to sercer

Someone suggested in a now deleted comment to try rsync from local via ssh to server instead of the other way around. This doesn't work. It will give an error like this one:

rsync -zarvh oem@ /var/www/html/release
bash: rsync: command not found
  • 1
    See which libraries it wants/needs with ldd ./rsync. You get better compression efficiency by compressing the 1 big file (the archive) than by compressing any number of small files individually. – waltinator Apr 26 at 23:40
  • Added ldd output to question text. Good idea. – CoderGuy123 Apr 27 at 5:40
  • 1
    Since the host appears to be a Red Hat clone, have you tried using the compatible rsync binary instead of the Ubuntu one to see if it works better? – GracefulRestart Apr 27 at 20:58

Unpack rsync and the required missing libraries to e.g. $HOME/rsync

Run rsync this way:

cd $HOME/rsync
# or
export LD_LIBRARY_PATH=$HOME/rsync

Where does one find these missing libraries for download?

  1. Run rsync, you'll see missing libraries.
  2. For each of them run the following: dnf whatprovides '*/library.so'
  3. Download the required RPMs from any mirror
  4. Use e.g. rpm2cpio and then cpio -idv -F file.cpio to extract the RPMs.

Lastly you can compile rsync on another PC statically and copy the resulting file back to your server.

  • Where does one find these missing libraries for download? – CoderGuy123 Apr 28 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.