Skip to content

Instantly share code, notes, and snippets.

@guyru
Last active September 9, 2022 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save guyru/ec5ebf280d0d9e7f6b5b87a7e5427d95 to your computer and use it in GitHub Desktop.
Save guyru/ec5ebf280d0d9e7f6b5b87a7e5427d95 to your computer and use it in GitHub Desktop.
Autostart rclone mount using systemd
[Unit]
Description=Dropbox (rclone)
AssertPathIsDirectory=%h/Dropbox
# Make sure we have network enabled
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount --vfs-cache-mode full Dropbox: Dropbox
# Perform lazy unmount
ExecStop=/usr/bin/fusermount -zu %h/Dropbox
# Restart the service whenever rclone exists with non-zero exit code
Restart=on-failure
RestartSec=15
[Install]
# Autostart after reboot
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment