Move large amounts of data using ssh instead of web GUI

Hello all,

I hope you don’t mind that i haven’t included logs, versions, etc but I think they’ll all be surplass to what you’ll need to help me here if I’m detailed enough in my question, but I may be wrong, so do scold me if needs be and I’ll go and get all the info!

I’m running the latest version of Nextcloud, using Docker on Open Media Vault and I have everything working nicely. There are just three users, me, my wife, my daughter, and my wife has a few thousand photos on her phone that I’d like to send to the server, so that her phone works again!

I’d prefer not to do this using the web GUI, so can it be done using rsync, or similar, using ssh? If so, I have these related questions:

  1. Is it okay for me to transfer files using ssh into someone else’s private (Photos) folder, will they be able to see them, delete them, move them? Its just that I did play around with ssh before and although I moved the files, the user could not then move, delete, open the files.

  2. I use DuckDNS to access Nextcloud both inside and outside of the LAN, can I somehow ssh into the server using its IP address, would this make the transfer faster? I am guessing it would!

I might also need a bit of help with the commands, and whether I need to be in a certain directory to use them as I’m quite new to the command line, these are all basic questions, I am sure, to those with more experience than me.

Thank you, and thank you for Nextcloud!


I know you dont want gui but… why don’t you use the android app (or ios) that can send photo automatically : Using the Nextcloud Android App — Nextcloud Android App 1.0.0 Manual 1.0.0 documentation
If you want, all media taken by camera can be instantly upload on your server (you can chose to keep or delete the original on your phone).

You can use ssh but you complicate your life.
If you want to use ssh from your phone, I know that there are some ssh applications on android store. If you manage to use ssh (scp) to copy file on your server, a simple rights and owner check and occ scan will show the file on NC gui.

I don’t think it is faster than Nextcloud Android app. I think that the fatest way is to transfer with usb key… (if you have a physic access to your server).

If you connect your phone to LAN, your box is smart enough to connect directly to the server through the LAN.

I hope this will help you

Hi there,

Thanks very much for the advice - I have no idea why I haven;'t considered USB before as I have a physical connection to the server.

Yes, we all have the app on our phones but I’d like to save my wife the inconvinience of uploading all the files, very interesting what you say about the app being smart enough to use the LAN though!

So, I plug the USB drive into the server and then copy the stuff over. I might need a hand with the commands for this, so I will see what I can find out on my own and get back to you, if that’s okay?

After that, I will set her phone up to copy the files to the server immediately.

I wil also need a hand with the occ scan.

thanks for your help, much appreciated!

The app has a feature to auto-upload your photos. The initial sync will take some time I’m sure, but it works.

You can upload the files using other means such as SSH. Whether you should is another matter. You can transfer the files directly to her data folder, but after making manual changes like this, you have to run ‘occ files:scan’ to being the database back into consistency with the files.

Avoid doing that unless you really need to. A lot of people tinker with the data folder and end up breaking it.

It would make no difference. All the DNS record does is translate to an IP address. The rest is the same process.

I recommend using sftp, which is ftp over ssh. It works fine to migrate lots of data, but you will need to re-scan your system as an admin afterwards for it to understand the changes. See admin documentation for details on occ.

This might be a somewhat round about way, but consider the following assuming you’re running windows.

  1. Using usb copy all pics from phone to a folder on the pc
  2. Set that folder as sharable.
  3. using nextcloud’s external storage, map that folder into nc as a smb/cifs share
  4. Copy from mapped folder to folder of your choice on nc using the UI

This isn’t the fastest. But keeps things simple as far as permissions, having to rescan the folder structure to update database, etc.

Assuming you already have some sort of folder access to the nas, you could just copy everything over from the pc (even if its to an existing share). Once copied, ssh to the nas console, move files to where you want them to be, update ownership/permissions then rescan to update database.

If it were me, I’d probably choose method #2 especially if the volume of data is large - more than a gig or two. This way you’re copying at full network line speed (gigabit?).

On second thought the suggestion above to connect phone via usb directly to the nas is prob the fastest if your nas has a usb connection.

yes no problem. Next time, think about tagging me just like this @nick0, otherwise I will not receive notifications.