Instant syncing with NextCloud

What is the problem you are having with rclone?

I'm trying to figure out how to make RClone sync changes to files instantly, as I have a KeePass database that's on my phone and on my desktop. However the changes never seem to appear on my desktop (nor from my desktop to my phone). Is it possible to make RClone sync Nextcloud instantly or sync whenever I change a file? My systemd file looks exactly as this one.

What is your rclone version (output from rclone version)

rclone v1.56.1

  • os/version: arch rolling (64 bit)
  • os/kernel: 5.14.8-zen1-1-zen (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.17.1
  • go/linking: dynamic
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Nextcloud

The command you were trying to run (eg rclone copy /tmp remote:tmp)

systemctl --user enable --now rclone@nextcloud

The rclone config contents with secrets removed.

[gdrive]
type = drive
client_id = 
client_secret = 
token = {"access_token":"","token_type":"Bearer","refresh_token":"","expiry":""}
root_folder_id = 

[gpictures]
type = google photos
client_id = 
client_secret = 
token = {"access_token":""}

[mega]
type = mega
user =
pass = 

[nextcloud]
type = webdav
url = https://blah.blah.org/remote.php/webdav/
vendor = nextcloud
user = 
pass = 
bearer_token = 

A log from the command with the -vv flag

Are you writing to a mount? Mounts would reflect all changes as you'd see that in a log file for the mount as well.

Yeah, on my phone I'm writing directly to my NextCloud instance (using the NextCloud Android app) but the changes aren't being synced by rclone at all despite NextCloud showing the changes directly on the website. Also for some reason I can't get any logs to display at all, I would run the journal command but would have the following happen:

$ journalctl rclone@nextcloud
Failed to add match 'rclone@nextcloud': Invalid argument

Sorry as I don't know much on Android so perhaps someone else can help out.

I don't think it's because of Android, because if I do any changes to the same file on my laptop, rclone still doesn't sync the changes at all; but if I run the NextCloud client on my desktop, it syncs the changes instantly so it's something going on with rclone not instantly syncing the changes

hi,
that systemd file looks out of date, uses the cache remote, which has been deprecated and can no longer be found on the rclone website.

what is the value of --dir-cache-time="${RCLONE_MOUNT_DIR_CACHE_TIME}"
a rclone mount will only update its local vfs cache using that value.

if i understand correctly, this seems to be a windows issue.
if correct, need to get the windows mount working, as adding android just makes this more complex to solve.
it not correct, let me know..

might want to redact the config file, and remove this.
url = https://cloudnova.duckdns.org/remote.php/webdav/

please post the rclone mount command on windows.

fwiw,
on windows:
each time i make a change to keepass database, i have setup keepass trigger to rclone copy the .kdbx file to cloud. keepass itself does not have network access, blocked via firewall.
i do not use rclone mount

on android:
i never edit the .kdbx, so in-effect read-only. i use keepass2android, offline edition, more secure, no internet access
i use rclone on termux to copy that .kdbx from cloud to local.

I'm on EndeavourOS, not Windows. And oddly enough,I can't edit the original post to remove the url.

ok, not windows.

pehaps use a rclone debug log and/or --log-systemd

It appears to be 60m, didn't change anything on the systemd file, it's exactly the same as what's on the page.

not sure but i am assuming nextcloud is not a polling remote. that would be seen in a rclone debug log.
in that case, 60m, rclone will only check for changes in the nextcloud remote every 60 minutes.

as a test,

  • use --dir-cache=1m
  • make a change in a file in nextcloud.
  • wait one minute
  • using a file browser, refresh it, to look for a change in the modtime of the file(s).

https://rclone.org/commands/rclone_mount/#vfs-directory-cache

note: there is a way to force rclone mount to update its local dir-cache to match nextcloud and not wait for --dir-cache-time to expire

i could be wrong but using --no-modtime might not be a good idea.

1 Like

Finally, I got it working and it all changes like it's suppose to with changing that dir-cache time to 1m instead of 60, however I noticed that the modified time of the file doesn't actually change (like, it won't update the modified time entry in the file explorer). Is there a way to make it do so?

good,

about the modtime issue, try removing --no-modtime

1 Like

That fixed it, thanks!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.