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