dd
This commit is contained in:
parent
52b867f057
commit
e39c554ae5
2 changed files with 26 additions and 2 deletions
|
@ -236,27 +236,40 @@ pve_pbs_datastore:
|
|||
rsync_mirror_dirs: # "/" beachten!
|
||||
- src: /hdd_data/tmp
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/archiv
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/archiv"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/backup
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/backup"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/bilder
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/bilder"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/buecher
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/buecher"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/music
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/music"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/programme
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/programme"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/pve_backup
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/pve_backup"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/restic
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/restic"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/scans
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/scans"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/tmp
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/videos
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/videos"
|
||||
dest_mount_check:
|
||||
- src: hdd_data/vm
|
||||
dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/vm"
|
||||
dest_mount_check:
|
||||
|
|
|
@ -2,9 +2,20 @@
|
|||
{{ file_header | default () }}
|
||||
|
||||
{% for item in rsync_mirror_dirs %}
|
||||
{# Header #}
|
||||
echo "-----------------------"
|
||||
echo "Source: {{ item.src }}"
|
||||
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 }}
|
||||
{# Mount check source #}
|
||||
if /usr/sbin/zfs get mounted -H {{ item.src } ; then
|
||||
{# Mount check destination #}
|
||||
if [ $(ssh {{ 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 --verbose --human-readable --stats --compress --fuzzy --force --delete-after --recursive {{ item.src }} {{ item.dest }}
|
||||
else
|
||||
echo "Destination-Dataset not mounted!"
|
||||
fi
|
||||
else
|
||||
echo "Source-Dataset not mounted!"
|
||||
fi
|
||||
echo ""
|
||||
{% endfor %}
|
||||
|
||||
|
@ -14,4 +25,4 @@ echo ""
|
|||
# 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!"
|
||||
/usr/sbin/zfs get mounted -H hdd_data/tmp 2>&1 > /dev/null || echo "Dataset not mounted!"
|
||||
|
|
Loading…
Reference in a new issue