Rsync SSH to another server

Thanks for a great pack of software. I really enjoy learning how to use NextClouDPI

That being said, I cant wrap my head around how to ssh rsync to another server and then get my backup uploaded.
Is there a howto for this somewhere I might have missed?

Your question is not Nextcloud related. Using ssh and rsync will be a question for any search machine.

NCP provides nc-rsync and nc-rsync-auto
either through ncp-config or ncp-web

Here is the wiki’s configuration reference for rsync.

I am facing the same problem, since there is nothing rsync related in the documentation.

I have a NextCloudPi an an Openmediavault and want to sync NCP to OMV.

Really? I used the search field, typed “rsync” and got to this:

And while rsync is a unix tool which is only utilized by the NCP developer, there is plenty more documentation for rsync, ssh and so on on the Internet.

1 Like

Oh thank you @Schmu.

I don’t get how to auto-login… Do I need to create RSA-keys and share the public key to NCP?

The other way round. You need the public key on the backup device and the private key on your NCP, if you want to “auto-connect” to another server via SSH. There are several guides out there, which explain the key pair generation and where to put the files afterwards.
This guide here looks pretty good on the first glance:

Afterwards “auto login” is setup and you should be able to login with simple
ssh <user>@<backup server IP>

and your rsync can be configured and should work afterwards as well.

type ssh keyauth into your se of choice; this ia a

general example on debian

Thanks @Schmu

So finally I got this, automatic login works:

amilopowers@nextcloudpi:/home$ rsync -e 'ssh -p 22' -av /home/amilopowers/ root@
sending incremental file list
created directory /NextcloudPi
sent 12,909 bytes  received 283 bytes  8,794.67 bytes/sec
total size is 11,937  speedup is 0.90

When I then try to start rsync from the weg panel i get this:

[ nc-rsync ]
Maintenance mode enabled
Nextcloud is in maintenance mode - no apps have been loaded

ssh_exchange_identification: Connection closed by remote host
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(235) [sender=3.1.2]
Maintenance mode disabled

I bet your Nextcloud user is different from user that you did test before (amilopowers) and he could not access you key. You have to specify it and it should be accessible for NC user. Added to rsync something like this (you do not need -p 22 because 22 is standard ssh port):

...-e "ssh -i <SSHIdentityFile>" <DirectoryToSync> <SSHUser>@<RemoteAddr>:<RemoteBackupFolder>

Here is an example: