Skip to content

Instantly share code, notes, and snippets.

@MatteoR23
Created April 25, 2023 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MatteoR23/03ce7bfae5d3944528de996fde262344 to your computer and use it in GitHub Desktop.
Save MatteoR23/03ce7bfae5d3944528de996fde262344 to your computer and use it in GitHub Desktop.
# User service for Rclone mounting
#
# Place in ~/.config/systemd/user/
# File must include the '@' (ex rclone@.service)
# As your normal user, run
# systemctl --user daemon-reload
# You can now start/enable each remote by using rclone@<remote>
# systemctl --user enable --now rclone@dropbox
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
ExecStartPre=-/usr/bin/mkdir -p %h/mnt/%i
ExecStart= \
/usr/bin/rclone mount \
--config=%h/.config/rclone/rclone.conf \
--vfs-cache-mode writes \
--vfs-cache-max-size 100M \
--log-level INFO \
--log-file /tmp/rclone-%i.log \
--umask 022 \
--allow-other \
%i: %h/mnt/%i
ExecStop=/bin/fusermount -u %h/mnt/%i
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment