Can I send files TO my Nextcloud server via (s)ftp?

rclone (rclone.org) can sync files from an ftp and webdav (nextcloud) easily. I use it to sync pictures from my security cameras.

Hi
maybe this will help:
I had a similar use-case. I send files from my printer to Nextcloud via ftp. I use a dedicated FTP server that mounts the Nextcloud destination directory using davfs2 (i.e. with WebDav):
To do this, I set up a special user (named “scan”) on Nextcloud that is used only for scanning. This Nextcloud user holds the directory into which scanning is performed.
This directory is then shared with all Nextcloud users who want to have the “scan feature” (via share directory).
On the FTP server I mount the Nextcloud scan directory of the user “Scan” using davfs and configure the target scan directory of the FTP server to the same directory of the scan user. This way I use the official WebDav protocol supported by Nextcloud to save from the FTP server to Nextcloud.

The whole thing is described here (but in German): Nextcloud Sync mit Ftp-Server – www.dev-metal.ch

Hi Kacey,

FTP is fine with an extra step, you just have to manually update the NC file database after the FTP, like this:

php occ files:scan myusername

After it finishes, all the new files show up and it all works great. I FTP (scp really) files to my NC server all the time, and I run a script that ssh’es into my server and runs the above command.

Thanks @rubin

Any chance you could paste the contents of the script you use?

scp/rsync ist fast(er), but it’s annoying to always have to run occ:files scan after it.
if you have shell-access to your webhost you can use davfs (davfs2) which can connect to your nc-instance as the correct user and just mount some dir someplace on your webhost. i use it mainly on gui systems so users have a “folder” to “see” stuff in but it works on headless systems, too.
the rough steps would be: install davfs(2), configure it (as root via /etc/fstab and /etc/davfs2/…); configure it for the user that runs the script (in my version the mountpoint stated in /etc/fstab and the one configured by the user must be identical); mount; copy; umount; done.

another way would be using a really dirty hack (with eg curl) and passing user/pw in the URL (not recommended, but possible).
GOOD LUCK!