Welcome to the mailbox user forum
 

The Drive under Linux - Alternative Setup

Jesper Frickmann shared this idea 2 months ago
Proposed

I found some inspiration in a blog post for an alternative way to synchronize the files on my Mailbox Drive with a local directory on Linux.

It uses rclone bisync, which is currently a beta testing feature on the latest rclone version, which is not yet included in "stable" releases of common Linux distros. I installed the "testing" version of rclone on my Debian system, and I have had it running for a couple of weeks, so far without problems. I have not done any heavy usage or testing, however.

It is a bash script that installs itself as a user systemd service, and it uses inotifywait to trigger synchronization when local files are changed, and otherwise it synchronizes every 10 min. in case something changed in the other end.

You can find the script and a more detailed description here: https://codeberg.org/jfrickmann/rcloud

Replies (4)

photo
1

Thanks for sharing your interesting implementation - I was unaware that rclone can now use bisync to solve the two-way sync problem.

The official knowledgebase article that describes the manual process of connecting Mailbox Drive on Linux suggests using a software called FreeFileSync to solve that problem. But that software requires a paid license for commercial use, so your rclone solution nicely maintains the Free and Open Source Software spirit.

---

I was curious about your implementation because I also implemented a setup assistant for Mailbox Drive on Linux (although mine uses FreeFileSync): https://github.com/kevin-pw/mailboxorg-drive-assistant

This collection of shell scripts automates all of the steps described in the official knowledgebase article because I needed to simplify the on-boarding of my team members onto Mailbox Drive. The setup script mounts the remote Drive via WebDAV, creates a local working directory, and configures automatic background syncing between the directories.

Features include:
- The interactive setup guides the user through the installation.
- The installation is idempotent with robust error handling so that the setup can safely re-run after a failed attempt.
- Sensible default values specific to Mailbox.org and auto-detection of configuration variables minimize required user inputs.
- After installation, the local and remote directories automatically sync in both directions and on system startup.
- The README.md describes the complete Drive synchronization architecture, its components, and its dependencies.
- The uninstall script cleanly removes all components associated with any previous complete or incomplete installation attempts.

Please excuse that I am posting my repo in your thread, but I think collecting our similar tools in one place is more appropriate than starting a new unsolicited post on this forum. I have tested and refined my repo with my team, so hopefully this thread is useful for others.

photo
2

Hi Kevin,

I am aware of the solution provided by the Mailbox KB using FFS. What I like about my own solution, is that it syncs directly without needing a local mount, that it works as a standard systemd service, that it sends errors and warnings to the GUI with notify-send, and that so far it has worked without any problems for me.

But it should be noted that my solution is based on a beta feature in the newer versions of rclone that are not yet the standard version in most distros today. Since it is, however, in the current Debian testing repo, it can be expected to be included when Forky becomes the next stable release sometime in the middle of 2027. And when Debian has it, everyone has it :-)

photo
1

Hi Jesper,

Thanks for pointing out that your solution does not require a local mount. Agreed - avoiding the need for duplicate files in the local and remote directories (as is currently required by the official KB solution and my own implementation) is indeed a leaner architecture. I like it!

It looks like the necessary rclone version is already available on the latest Ubuntu Linux 26.04 because I see that bisync was added to rclone v1.58, and the apt repos currently provide rclone v1.60.1. But the latest release is v1.74.2 and bisync has seen several improvements recently, so downloading the latest official release of rclone is probably the most stable option for most users.

I will probably migrate my own Drive assistant repo to replace FreeFileSync with rclone in the coming days since your solution already provides a working template. I appreciate the inspiration :)

photo
2

Excellent, please keep us posted when you get there!

And great to know that Ubuntu already has the later rclone versions included too.

photo
1

Hey, I recently found your solution on codeberg. Seemed a lot nicer than the freefilesync alternative. Also I really like your script, because I'll need to set it up on a couple of machines. Unfortunately I wasn't able to set it up.

1. The latest rclone flatpak version (1.74.3) finished the dry run without errors but then barfed out permission errors for every file, even though the permissions were set correctly. I guess I should report that to rclone.

2. Using the rclone version you specified (1.69.4) I get a warning that Modtime isn't supported by the remote, which would be Mailbox. Makes me wonder how it is running on your end. Did you switch to checksum or size-only? I would assume checksum is too bandwith/resource intensive, but size-only might not always get every change.

3. systemd won't register the service that was setup. I simply couldn't get that to work even manually, but as I see it, that is just needed to start the script on login. So I could just add the command to Startup Applications on my system (Zorin OS 18.2). Maybe you could add a prompt to ask whether to set this up or print out the command line to add yourself.

Either way, thanks for publishing your script. Even though I haven't gotten it to work, yet, I wouldn't have found this option without it.

Edit: I also couldn't get it to run with the version from the Ubuntu repositories (1.60.1). That gave me a message that one of the flags wasn't recognized, so I assumed that bisync wasn't properly implemented at that point.

photo
1

1. Yeah, it sounds like a problem with that version or build of rclone - I don't know.

2. I get the same warning, but I decided to ignore it, as it works fine. I could start adding flags to make it go away, but that would loose the general utility of the script. And, as you point out, going to e.g. checksums may increase the overhead considerably.

3. I have no experience with Zorin OS, but since it is based on Ubuntu, which is based on Debian, I would think that systemd would be similar. It uses the command

systemctl --user --now enable "${SERVICE_NAME}"
to add the service after writing the file to ~/.config/systemd/user/${SERVICE_NAME}. Have you tried

systemctl --user start "${SERVICE_NAME}"
In any case, my version of rclone still warns that bisync is beta, so your mileage may vary.

Have you tried if your rclone configuration of Mailbox Drive works by e.g.

rclone lsd mailbox:

photo
1

rlcone lsd mailbox: works. Dry run and first sync work as well with 1.69.3. It's just the warning that makes me wary. I read a little more about the alternative comparison methods, but I think for this usecase we really need modtime or we'll run into issues eventually as rclone can't determine if a file is older or newer without it (https://rclone.org/bisync/#compare).

Zorin OS is basically Linux Mint with Gnome2. It has systemd so it should work. I read your bash script and tried to do add it manually and followed a few tutorials, but systemctl status mailbox_drive always returns that it couldn't be found. But if it's just about starting the command, I think I don't need to do it that way. Doesn't look like it's starting the service in intervals. That's what the script does, if I'm not mistaken.

photo
1

I also get the warnings, but since it works, I use it anyway. I hope/assume that the modtime issue gets fixed when it is out of beta.

For the systemd service, how about

journalctl --user -u mailbox_drive
Does that show anything?

photo
1

Well, look at that. The service is actually running! Tried some changes in a text document and it seems to be working. Awesome, thanks!

photo
1

Great 😀

photo
Leave a Comment
 
Attach a file
You can't vote. Please authorize!