[VBACKUP-SINGLE] Added enc password and pigz compression

This commit is contained in:
Simon Cornet 2020-01-09 18:13:23 +01:00
parent 52b7ac88a5
commit df312d3200

View File

@ -6,6 +6,7 @@ vm_dataset="zroot/vms"
vm_pid=`/usr/bin/pgrep -f "bhyve: $vm"`
backup_location="/tank/backup/vms/"
backup_date=`date "+%Y-%m-%d"`
enc_password="nDNmPPBPk7jQnwke"
# snapshot vm
echo ""
@ -24,9 +25,6 @@ for vm in $vm; do
do
ps -p $vm_pid > /dev/null
done
vm list | grep $vm ## DELETE ME
fi
echo ""
@ -53,9 +51,9 @@ for vm in $vm; do
## send snapshot to backup destination
zfs send $vm_dataset/$vm@$backup_date | \
gzip | \
openssl enc -aes-256-cbc -a -pbkdf2 -iter 1000 -salt -k development \
> $backup_location/$vm-$backup_date.gz.enc
pigz -c -p 4 | \
openssl enc -aes-256-ctr -a -pbkdf2 -iter 1000 -salt -k $enc_password \
> $backup_location/$vm-$backup_date.pigz.enc
## delete snapshot
sleep 1