I am using rclone to synchronize my password manager stored on Google Drive. I have a systemctl service running for my user and it works fine. But there is a downside. When I modify the password database on my computer, instead of making the modification remotely, it deletes the existing file and creates a new one with the same name.
This is not a Google Drive issue because making modifications from my phone doesn't give the same outcome.
This is really annoying because it breaks the synchronization of my database on other devices and it removes my version history on Google Drive.
I looked for relevant options available when mounting the drive but didn't find any. Can someone help? Is there a workaround? Did I misconfigured something?
[Unit]
Description=rclone mount service
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount keepassxc:KeepassXC %h/documents/keepassxc
[Install]
WantedBy=default.target
Hey, thank you your answer. God, this is exactly what I needed, --vfs-cache-mode writes fixes the overwriting behavior.
A bit more context on my setup since you asked:
To synchronize my database on other devices I either use the thick Google Drive client for Windows devices or Keepass2Android for my mobile devices. These don't have the same overwriting behavior. Keepass2Android doesn't automatically reopen the database once it has been overwritten by rclone though.
yeah, i also use keepass2android, but the offline version, that has no network access.
and i do not use google products.
i have a different setup, not using rclone mount.
i want the original database to be on local, not cloud.
i do not trust accessing a critical database via rclone mount and/or gdrive desktop client.
my main database is local on my windows machine. each time i make a change+save to the database:
on windows, a keepass trigger runs a .cmd script that uses rclone to copy the .kdbx from local to cloud
on android, i use termux to run a .sh script, that uses rclone to download the .kdbx from cloud to local
Interesting, you basically make a copy instead of mounting the whole thing. Will it propagate both ways, regardless of the device used to make the modifications on your database?
tl;dr - the data in the keepass database is way too important to trust third parties, different programs on different operating system doing cloud sync on gdrive, rclone mount and so on.
all that seem very fragile to me.
no, i found that approach too fragile, too many moving parts, and having to trust some third-party keepass2android to modify a database that will be used by official keepass. as keepass changes it database format and fixed bugs, no trust that keeppass2android will do the same.