Backup whole partition
Ir para navegação
Ir para pesquisar
#!/bin/bash -x
if [ $# -ne 2 ]
then
exit 1
fi
export BACKUPPATH=/backup_so
export BACKUPOUTPUT=$BACKUPPATH/$(date +"%Y%m%d%H%M%S")-$1-$2
mkdir -p $BACKUPOUTPUT
cd $BACKUPOUTPUT
lvcreate -s -n snap -L 5G $1/$2
tune2fs -U $(uuidgen ) /dev/$1/snap
partclone.ext4 -o - -c -s /dev/$1/snap | pigz -p $(lscpu | grep ^CPU\( | awk '{print $2}') | split -b 1G - $2.
lvremove $1/snap -f