Created
April 27, 2023 17:22
-
-
Save Finkregh/7c16a70178318676f7e9f96bbf4061d2 to your computer and use it in GitHub Desktop.
rclone systemd timer
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] | |
Description=rclone %i | |
[Service] | |
Nice=19 | |
IOSchedulingClass=idle | |
#KillSignal=SIGINT | |
EnvironmentFile=/usr/local/etc/rclone-spawn/%i.env | |
ExecStart=/usr/local/bin/rclone-spawn.sh %i | |
[Install] | |
WantedBy=multi-user.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] | |
Description=Weekly rclone %i | |
[Timer] | |
OnCalendar=weekly | |
AccuracySec=1h | |
Persistent=true | |
[Install] | |
WantedBy=multi-user.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
#!/usr/bin/bash | |
set -euo pipefail | |
if [[ -f /usr/local/etc/rclone/${1}.filter ]]; then | |
RCLONE_FILTER="--filter-from /usr/local/etc/rclone/${1}.filter" | |
fi | |
${RCLONE_PRE_COMMAND:-} | |
rclone --config /usr/local/etc/rclone/${1}.conf -v --stats 60s ${RCLONE_FILTER:-} ${RCLONE_SUBCOMMAND} | |
${RCLONE_POST_COMMAND:-} |
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
[remote] | |
account = somethingsomething | |
key = secretsecret | |
type = b2 | |
folder = / | |
bucket = bucketname | |
chunk_size = 96M | |
fast_list = false |
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
RCLONE_SUBCOMMAND="--dry-run sync /source remote:bucketname/" | |
# run some command/s before rclone | |
RCLONE_PRE_COMMAND="echo something something" | |
# run some command/s after rclone | |
RCLONE_POST_COMMAND="echo do some notification?" |
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
- .zfs | |
- .zfs/** | |
- cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment