From 840037aa4619535aa5435a07c45f573c96deedbd Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 29 Oct 2024 15:52:40 +0100 Subject: [PATCH] sdfg --- .../mgrote_rsync/templates/rsync_mirror.sh.j2 | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 b/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 index 1cb9cbf9..e499c4a1 100644 --- a/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 +++ b/roles/mgrote_rsync/templates/rsync_mirror.sh.j2 @@ -10,7 +10,7 @@ echo "Destination: {{ item.dest.split(':') | last }}" if /usr/sbin/zfs get mounted -H {{ item.src }} 2>&1 > /dev/null ; then {# Mount check destination #} if [[ "$(ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no {{ item.dest.split(':') | first }} /usr/sbin/zfs get mounted -H {{ item.dest.split(':') | last }} | cut -f3)" -eq "yes" ]] ; then - rsync -e "ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no" --dry-run --bwlimit={{ rsync_mirror_bw_limit }} --archive --omit-dir-times --human-readable --stats --compress --fuzzy --force --delete-after --recursive {{ item.src }} {{ item.dest }} + rsync -e "ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no" --dry-run --bwlimit={{ rsync_mirror_bw_limit }} --archive --verbose --itemize-changes --omit-dir-times --human-readable --stats --compress --fuzzy --force --delete-after --recursive {{ item.src }} {{ item.dest }} else echo "Destination-Dataset not mounted!" fi @@ -19,12 +19,15 @@ else fi {% endfor %} - -# --checksum ; https://serverfault.com/questions/211005/rsync-difference-between-checksum-and-ignore-times-options - - -# beispiel cmd hier rein - -# --itemize-changes - -# rsync: [generator] failed to set times on "/backup/pve5/tmp/.": Operation not permitted (1) +{# Beispiel +echo "-----------------------" +echo "Source: /hdd_data/tmp/" +if /usr/sbin/zfs get mounted -H /hdd_data/tmp/ 2>&1 > /dev/null ; then + if [[ "$(ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no rsync_mirror@pbs.mgrote.net /usr/sbin/zfs get mounted -H /backup/pve5/tmp | cut -f3)" -eq "yes" ]] ; then + rsync -e "ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no" --itemize-changes --bwlimit=2m --verbose --omit-dir-times --archive --human-readable --stats --compress --fuzzy --force --delete-after --recursive /hdd_data/tmp/ rsync_mirror@pbs.mgrote.net:/backup/pve5/tmp/ + else + echo "Destination-Dataset not mounted!" + fi +else + echo "Source-Dataset not mounted!" +fi#}