mirror of
https://github.com/bashclub/bashclub-zfs-push-pull.git
synced 2024-12-25 06:00:13 +01:00
e1cb6d35ec
Using that Script collects all Datasets/ZVOLs from a partent Daset and creates individual Jobs instead of a faulty recursive replication
16 lines
571 B
Bash
16 lines
571 B
Bash
#!/bin/bash
|
|
SCRIPTPATH='/root'
|
|
SOURCEHOST='host.dom.tld'
|
|
SOURCEPATH='rpool/data'
|
|
DESTPATH='rpool/data/Replica'
|
|
PORT='22'
|
|
SOURCEALL=$(ssh -p$PORT root@$SOURCEHOST 'for src in $(zfs list -H -o name |grep '"$SOURCEPATH"'/|grep -v alt|grep -v state|grep -v disk-9); do echo ${src##*/}; done') #determines Source Datasets without 'alt, state and disk-9' in Name - Those are typlically not replicated
|
|
echo ''
|
|
echo Repliziere von $SOURCEHOST $SOURCEALL
|
|
echo ''
|
|
for DATA in $SOURCEALL
|
|
do
|
|
$SCRIPTPATH/bashclub-zfs -p $PORT -k 5 -v $SOURCEHOST:$SOURCEPATH/$DATA $DESTPATH
|
|
done
|
|
###
|