mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-23 03:02:32 +01:00
Merge branch '11293-partition_table_backup' into 'master'
Do not try to dump partition tables for a disk when non are detected Closes #11293 See merge request riseuplabs/backupninja!22
This commit is contained in:
commit
0491432147
@ -609,12 +609,18 @@ fi
|
||||
if [ "$partitions" == "yes" ]; then
|
||||
if [ "$dosfdisk" == "yes" ]; then
|
||||
devices=`LC_ALL=C $LSBLK --output NAME,TYPE --list --paths 2>/dev/null | grep "disk$" | grep -v '^/dev/zram' | @AWK@ '{print $1}'`
|
||||
partitions=`LC_ALL=C $SFDISK -l 2>/dev/null |grep "^/dev" | @AWK@ '{print $1}'`
|
||||
if [ "$devices" == "" ]; then
|
||||
warning "No harddisks found"
|
||||
fi
|
||||
for dev in $devices; do
|
||||
debug "$SFDISK will try to backup partition tables for device $dev"
|
||||
[ -b $dev ] || continue
|
||||
echo "${partitions}" | grep -q "${dev}"
|
||||
if [ $? -ne 0 ] ; then
|
||||
info "The device $dev does not appear to have any partitions"
|
||||
continue
|
||||
fi
|
||||
label=${dev#/dev/}
|
||||
label=${label//\//-}
|
||||
outputfile=${partitionsfile//__star__/$label}
|
||||
|
Loading…
Reference in New Issue
Block a user