Skip to content

Instantly share code, notes, and snippets.

@holazt
Forked from guyru/rclone-dropbox.service
Created April 1, 2022 13:15
Show Gist options
  • Save holazt/a57e69e53b9d4b008faa2923c020e195 to your computer and use it in GitHub Desktop.
Save holazt/a57e69e53b9d4b008faa2923c020e195 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
@holazt
Copy link
Author

holazt commented Apr 1, 2022

Autostart rclone mount using systemd

Create the following file under ~/.config/systemd/user/rclone-dropbox.service:

https://gist.github.com/guyru/ec5ebf280d0d9e7f6b5b87a7e5427d95

Reload the user services, enable and start the new service:

$ systemctl --user daemon-reload
$ systemctl --user enable --now rclone-dropbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment