mirror of
https://github.com/bashclub/bashclub-zfs-push-pull.git
synced 2024-12-25 14:10:13 +01:00
17 lines
491 B
Bash
17 lines
491 B
Bash
#!/bin/bash
|
|
SCRIPTPATH='/root'
|
|
SOURCEHOST='host.dom.tld'
|
|
SOURCEPATH='rpool/data'
|
|
DESTPATH='rpool/data/Replca'
|
|
PORT='10022'
|
|
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/backup-zfs -p $PORT -k 5 -v $SOURCEHOST:$SOURCEPATH/$DATA $DESTPATH
|
|
done
|
|
###
|
|
~
|