Skip to content

Instantly share code, notes, and snippets.

@Tedpac
Last active April 20, 2025 15:49
Show Gist options
  • Save Tedpac/4b198d79f2d17cc19dff37b6d7861138 to your computer and use it in GitHub Desktop.
Save Tedpac/4b198d79f2d17cc19dff37b6d7861138 to your computer and use it in GitHub Desktop.
Systemd Service Template for Mounting Cloud Storage with Rclone
[Unit]
Description=
Documentation=man:rclone(1)
Wants=network-online.target
After=network-online.target
[Service]
Type=notify
EnvironmentFile=/etc/default/rclone
Environment="MOUNT_POINT=%h/.mnt/<cloud_storage_provider>"
Environment="RCLONE_REMOTE_PATH="
Environment="RCLONE_FLAGS="
ExecStartPre=/usr/bin/mkdir --parents "${MOUNT_POINT}"
ExecStart=/usr/bin/rclone mount "${RCLONE_REMOTE_PATH}" "${MOUNT_POINT}" "${RCLONE_FLAGS}"
ExecStop=/usr/bin/fusermount -u "${MOUNT_POINT}"
RestartSec=10
Restart=on-failure
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment