Skip to content

Instantly share code, notes, and snippets.

@ameeno
Last active February 17, 2022 15:24
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 ameeno/427e38825868abb6336251fb17ead7d1 to your computer and use it in GitHub Desktop.
Save ameeno/427e38825868abb6336251fb17ead7d1 to your computer and use it in GitHub Desktop.
rclone systemd service
# /etc/systemd/system/rclone.service
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/home/arun/google_drive/
After=k3s-node.service
[Service]
Type=simple
User=arun
Group=arun
ExecStart=/usr/bin/rclone mount --config=/home/arun/.config/rclone/rclone.conf remote: /home/arun/google_drive/
ExecStop=/bin/fusermount -u /home/arun/google_drive/
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
#### ALTERNATIVE
[Unit]
Description=Google Drive (rclone)
AssertPathIsDirectory=/home/arun/google_drive
After=k3s-node.service
[Service]
Type=simple
ExecStart=/usr/bin/rclone mount --config=/home/arun/.config/rclone/rclone.conf
--cache-tmp-upload-path=/tmp/rclone/upload
--cache-chunk-path=/tmp/rclone/chunks
--cache-workers=8
--cache-writes
--cache-dir=/tmp/rclone/vfs
--cache-db-path=/tmp/rclone/db
--no-modtime
--drive-use-trash
--stats=0
--checkers=16
--bwlimit=40M
--dir-cache-time=60m
--cache-info-age=60m remote:/ /home/arun/google_drive
ExecStop=/bin/fusermount -u /home/arun/google_drive
Restart=always
RestartSec=10
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment