Yeah, that is a limitation/design decision of systemd .path units.
Of course, one could probably make a .path unit which creates more .path units
Or, one might use incrond (package currently not widely available, though I have a build on OBS) which predates systemd and can do similar things when file locations change - and I thinkincrond can watch directories recursively.
thanks for sharing your job.
Is this script still working?
On y XA2 , I’m on SFOS 4.4.0.58, with SailSync 0.9.2 working like a charm.
But directory ~/.config/harbour-io.edin.projects.sailsync-owncloud/ doesn’t. Instead, I can found ~/.config/io.edin/harbour-io.edin.projects.sailsync-owncloud/ directory, but unfortunately, it is empty, with no config.db file.
Can you help?
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.
I’m using the old standard inotify + curl approach. But systemd is already there, and user units as I understand it live in user’s home, so I don’t recommend my method I just had recipes on hand for inotify (which is a sign of my age).
@nephros, you didn’t by any chance set up automatic syncing of contact and calendars? I’ve gotten so far that I can dump contacts or calendars and split them and sync em via vdirsync. Or maybe that works for you with the given tools.
Really? How? I spent 6 hours debugging this yesterday and it most certainly does not just work. Under some circumstances. Could you specify whether you had a ‘Personal’ calendar in your nc before setting up the phone? Are you using ‘Deck’ and or ‘Tasks’?
Testing another phone, account, now.
Using one of the calendars (the Personal that is default on nextcloud) from NC with a second account and other phone I have the same behaviour. None of my events from the phone’s default account get synced. But I’m debugging in another thread.
I havnt added to the calendar from the phone, i just add stuff in nextcloud web interface and see them appear on the phone. As you can see, it synced nextcloud contact birthdays, personal calendar and deck calendar
Ah, that’s what I meant. Stuff from the Phone Calendar and Contacts from the phone have to come from the nextcloud instance to sync. So, you’re in the same boat as I, I just made a false assumption. I’ve already synced contacts and calendars using vdirsync, so it looks like I need to ‘empty’ my phones and then sync. It’s a bit odd that sync on the phone won’t try to add the local calendars or contacts. Works fine from the phone with vdirsync.