A systemd user service template to automate mounting remote file systems using rclone.
The service template will use the same [remote]
name you specified when using rclone config create.
Each remote will be mounted in ~/mnt/[remote]
(created automatically).
To avoid confusion, mounting will fail if the mount point isn't empty.
If you are using a desktop environment:
Add user_allow_other
to /etc/fuse.conf
if not already there (this requires root privileges).
Install fusermount3
using your distribution's package manager.
For Debian: sudo apt install gvfs-fuse
Place rclone@.service
in ~/.config/systemd/user/
.
NOTE: The filename must include the
@
, e.g.rclone@.service
As your normal user, run
systemctl --user daemon-reload
You may now start/enable each rclone remote by using rclone@[remote]
systemctl --user enable --now rclone@dropbox
Rclone's logs will be written in /tmp/rclone-[remote].log
.
If you encounter the service ceasing to function when exiting the last session of ssh or not starting during boot, run
loginctl enable-linger [user]
Credits to Amy Nagle and the discussion contributors in this very helpful GitHub gist.