From d55baad105dc5127466e4316532495e8f956ec3d Mon Sep 17 00:00:00 2001 From: cpzengel Date: Mon, 11 Nov 2019 15:23:57 +0100 Subject: [PATCH] Add files via upload That simple Script detects all Datasets and ZVOLS on a remote SSH Site and pulling it to local ZFS Storage Should Work on ZOL like Debian/Proxmox and FreeBSD/FreeNAS --- 02pull | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 02pull diff --git a/02pull b/02pull new file mode 100644 index 0000000..08c48a9 --- /dev/null +++ b/02pull @@ -0,0 +1,14 @@ +SCRIPTPATH='/mnt/Raid' +SOURCEHOST='your.dom.tld' +SOURCEPATH='rpool/vms' # Example showing Proxmox Source +DESTPATH='Raid/ssd/32'# Example showing FreeNAS Destination (ssh-keygen and ssh-copy-id necessary) +PORT=10011 # NAT Rule on Source that redirects port 10011 to internal IP 11 on this Port +SOURCEALL=$(ssh 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 +### \ No newline at end of file