rclone: bwlimit (#352)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#352
Co-authored-by: mg <michael.grote@posteo.de>
Co-committed-by: mg <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2022-04-09 12:56:51 +02:00
parent d96018ca0b
commit dc6e3d77cc
3 changed files with 34 additions and 9 deletions

View file

@ -6,81 +6,99 @@
ziel: onedrive-encrypt:/Rest/KeepassDB
timer: "*-*-* 23:15"
state: true
- name: NC_od_docs
bwlimit: 2M
- name: nc_od_docs
quelle: nextcloud-mg:/Dokumente
ziel: onedrive-encrypt:/Dokumente
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: nc_sc_mg
quelle: nextcloud-mg:/
ziel: scaleway-encrypt-mg:/
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: nc_sc_amd
quelle: nextcloud-amd:/
ziel: scaleway-encrypt-amd:/
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_amd_glacier
quelle: "/shares_amd"
ziel: "scaleway-encrypt-glacier:/amd"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_archiv_glacier
quelle: "/shares_archiv"
ziel: "scaleway-encrypt-glacier:/archiv"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_backup_glacier
quelle: "/shares_backup"
ziel: "scaleway-encrypt-glacier:/backup"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_bilder_glacier
quelle: "/shares_bilder"
ziel: "scaleway-encrypt-glacier:/bilder"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_buecher_glacier
quelle: "/shares_buecher"
ziel: "scaleway-encrypt-glacier:/buecher"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_hm_glacier
quelle: "/shares_hm"
ziel: "scaleway-encrypt-glacier:/hm"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_musik_glacier
quelle: "/shares_music"
ziel: "scaleway-encrypt-glacier:/musik"
timer: "*-*-* 23:15"
loglevel: INFO
state: true
bwlimit: 2M
mode: "--size-only"
- name: smb_programme_glacier
quelle: "/shares_programme"
ziel: "scaleway-encrypt-glacier:/programme"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_vm_glacier
quelle: "/shares_vm"
ziel: "scaleway-encrypt-glacier:/vm"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_tmp_glacier
quelle: "/shares_tmp"
ziel: "scaleway-encrypt-glacier:/tmp"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_scans_glacier
quelle: "/shares_scans"
ziel: "scaleway-encrypt-glacier:/scans"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
- name: smb_restic_glacier
quelle: "/shares_restic"
ziel: "scaleway-encrypt-glacier:/restic"
timer: "*-*-* 23:15"
state: true
bwlimit: 2M
rclone_config: "{{ lookup('keepass', 'rclone.conf', 'notes') }}"

View file

@ -1,10 +1,17 @@
---
# ### mgote.rclone
# rclone_jobs: # Array of Jobs
# - name: nc_od_keepass # Jobname
# quelle: nextcloud-mg:/Rest/KeepassDB # Source
# ziel: onedrive-encrypt:/Rest/KeepassDB # Destination
# timer: "*-*-* 23:15" # Timer
# state: true # treu = present // false = remove
# rclone_config: "{{ lookup('keepass', 'rclone.conf', 'notes') }}" # rclone Config, use as Block
# ### mgote.rclone
# rclone_jobs: # Array of Jobs
# - name: smb_musik_glacier # Jobname
# quelle: "/shares_music" # Source
# ziel: "scaleway-encrypt-glacier:/musik" # Destination
# timer: "*-*-* 23:15" # Timer
# loglevel: DEBUG # Optional: Loglevel
# state: true # true = present // false = remove
# bwlimit: 2M # Optional: Bandwidthlimit
# mode: "--size-only" # Optional: mode (https://rclone.org/s3/)
# transfers # Optional: Transfers
# checkers # Optional: Checkers
# retries # Optional: Retries

View file

@ -7,4 +7,4 @@ OnFailure=rclone_mail@{{ item.name }}.service
[Service]
Type=simple
ExecStart=/usr/bin/rclone --config "/etc/rclone/rclone.conf" sync --log-level {{ item.loglevel | default ("INFO") }} --transfers {{ item.transfers | default ("8") }} --checkers {{ item.checkers | default ("8") }} --retries {{ item.retries | default ("5") }} --delete-after "{{ item.quelle }}" "{{item.ziel }}"
ExecStart=/usr/bin/rclone --config "/etc/rclone/rclone.conf" sync --log-level {{ item.loglevel | default ("INFO") }} --transfers {{ item.transfers | default ("8") }} --checkers {{ item.checkers | default ("8") }} --retries {{ item.retries | default ("5") }} --bwlimit {{ item.bwlimit | default ("0") }} {% if item.mode is defined %}{{ item.mode }}{% endif %} --delete-after "{{ item.quelle }}" "{{item.ziel }}"