From f38614a5070c85142e9294644076e5682069fef3 Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 28 Oct 2024 18:52:56 +0100 Subject: [PATCH] dsfg --- roles/mgrote_rsync/defaults/main.yml | 5 +++++ roles/mgrote_rsync/templates/rsync_mirror.sh.j2 | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/mgrote_rsync/defaults/main.yml b/roles/mgrote_rsync/defaults/main.yml index f5150765..7d5dbd8f 100644 --- a/roles/mgrote_rsync/defaults/main.yml +++ b/roles/mgrote_rsync/defaults/main.yml @@ -13,5 +13,10 @@ ------ rsync_mirror_user_group: "{{ rsync_mirror_user }}" rsync_mirror_user: rsync_mirror +rsync_mirror_bw_limit: "2m" # 2 Megabytes ### when should rsync_mirror be run (every 5 minutes) rsync_mirror_timer: '*-*-* *:00/5' + +rsync_mirror_dirs: +- src: /hdd_data/tmp # slashes beachten + dest: rsync_mirror@pbs.mgrote.net:/backup/pve5/tmp diff --git a/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 b/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 index b6201dd4..61253d9a 100644 --- a/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 +++ b/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 @@ -1,4 +1,6 @@ #!/bin/bash {{ file_header | default () }} -rsync befehle.... +{% for item in rsync_mirror_dirs %} +rsync -e "ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror" --checksum --dry-run --bwlimit={{ rsync_mirror_bw_limit }} --archive --verbose --human-readable --stats --compress --fuzzy --force --delete-after --recursive {{ item.src }} {{ item.dest }} +{% endfor %}