Skip to content

Instantly share code, notes, and snippets.

@cristiklein
Created December 10, 2023 18:19
Show Gist options
  • Save cristiklein/6cdd7f8dfa5f2c00c6b44aef44bdfb74 to your computer and use it in GitHub Desktop.
Save cristiklein/6cdd7f8dfa5f2c00c6b44aef44bdfb74 to your computer and use it in GitHub Desktop.
autosync with rclone and systemd
[Path]
MakeDirectory=true
PathChanged=%h/Drive
[Install]
WantedBy=paths.target
[Timer]
OnUnitInactiveSec=15m
[Install]
WantedBy=timers.target
[Unit]
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=rclone --verbose bisync drive:Drive %h/Drive
#!/bin/bash
rclone bisync --resync drive:Drive/ Drive/
systemctl --user daemon-reload
systemctl --user enable rclone.path
systemctl --user start rclone.path
systemctl --user enable rclone.timer
systemctl --user start rclone.timer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment