Addendum: the incredibly powerful tool rclone has support for many cloud storages, including WebDAV/Nextcloud and can be used as a replacement for Sailsync Owncloud or any other tools.
It also handles authentication much more securely, so obsoletes the .netrc stuff.
Set up the cloud target using rclone config, add a local or alias configuration for your local dirs, and call rclone from either a wrapper or directly from the systemd service.
rclone is not available from any repo (except from some ancient, dangerous Openrepos ones like Schtuhrman’s), but you can download and install the binary directly from the rclone web site. It’s just a single binary, so rather safe to install.
Here is an example config. Do not copy-paste this, use the command rclone config to set it up!):
[home]
type = alias
remote = /home
[my-home]
type = alias
remote = home:/nemo
[my-pics]
type = alias
remote = my-home:/Pictures
[nextcloud]
type = webdav
url = https://nextcloud.example.org/remote.php/webdav/
vendor = nextcloud
user = nextclouduser
pass = mYVeryS3cr3TP@assKeY
[nc-pics]
type = alias
remote = nextcloud:/Sailfish-Pictures
You would call this as:
rclone -q sync my-pics: nc-pics:
Or interactively (recommended for testing the first few tries):
rclone -i sync my-pics: nc-pics:
There is also an experimental ‘bisync’ mode which may or may not be what you want to try.
Do read the extensive rclone documentation before implementing any of this though.