bashclub-zfs-push-pull/02pull
cpzengel c8f19ac978
Update 02pull
Corrected Spelling
Default SSH Port 22
2022-02-04 15:37:24 +01:00

16 lines
486 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); do echo ${src##*/}; done') #determines Source Datasets without 'alt' in Name
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
###