homeserver/roles/mgrote_rsync/templates/rsync_mirror.sh.j2

18 lines
735 B
Text
Raw Normal View History

2024-10-28 18:24:29 +01:00
#!/bin/bash
{{ file_header | default () }}
2024-10-28 18:52:56 +01:00
{% for item in rsync_mirror_dirs %}
2024-10-29 14:22:28 +01:00
echo "-----------------------"
2024-10-29 14:21:45 +01:00
echo "Source: {{ item.src }}"
2024-10-29 14:31:59 +01:00
rsync -e "ssh -i /etc/rsync_mirror/.ssh/id_rsync_mirror -o StrictHostKeyChecking=no" --dry-run --bwlimit={{ rsync_mirror_bw_limit }} --archive --verbose --human-readable --stats --compress --fuzzy --force --delete-after --recursive {{ item.src }} {{ item.dest }}
2024-10-29 15:12:08 +01:00
echo ""
2024-10-28 18:52:56 +01:00
{% endfor %}
2024-10-29 14:31:59 +01:00
# --checksum ; https://serverfault.com/questions/211005/rsync-difference-between-checksum-and-ignore-times-options
2024-10-29 15:14:19 +01:00
# TODO
# check if src und dest are mounted
# # check if target dataset is mounted
/usr/sbin/zfs get mounted -H {{ item.destination_mount_check }} 2>&1 > /dev/null || echo "Pool not mounted!"