Created
December 10, 2023 18:19
-
-
Save cristiklein/6cdd7f8dfa5f2c00c6b44aef44bdfb74 to your computer and use it in GitHub Desktop.
autosync with rclone and systemd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Path] | |
MakeDirectory=true | |
PathChanged=%h/Drive | |
[Install] | |
WantedBy=paths.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Timer] | |
OnUnitInactiveSec=15m | |
[Install] | |
WantedBy=timers.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Documentation=man:rclone(1) | |
After=network-online.target | |
Wants=network-online.target | |
[Service] | |
Type=oneshot | |
ExecStart=rclone --verbose bisync drive:Drive %h/Drive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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