mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-03-17 21:31:45 +01:00
lndbackup also using backup device if connected (#4053)
* copy backup file to backupdevice (#3979) * #3979 adding free space check to backup device * just 50MB for safety is enough
This commit is contained in:
parent
ef47911beb
commit
684322e1e2
@ -169,6 +169,25 @@ if [ ${mode} = "lnd-export" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# if a backup device is connected (and has enogh free space) copy it there
|
||||
source <(/home/admin/config.scripts/blitz.backupdevice.sh status)
|
||||
if [ $isMounted == 1 ]; then
|
||||
|
||||
# get free space in bytes from backup device
|
||||
freeSpace=$(df | grep -m1 "/mnt/backup" | awk '{print $4}')
|
||||
|
||||
# subtract 50MB for safety
|
||||
freeSpace=$(expr ${freeSpace} - 50000000)
|
||||
|
||||
# check if enough space on backup device
|
||||
if [ ${freeSpace} -gt ${byteSize} ]; then
|
||||
echo "# making copy to backup device ..."
|
||||
sudo cp ${downloadPath}/lnd-rescue-${md5checksum}.tar.gz /mnt/backup/lnd-rescue-${md5checksum}.tar.gz
|
||||
else
|
||||
echo "# not enough space on backup device for extra copy'"
|
||||
fi
|
||||
fi
|
||||
|
||||
# output result data
|
||||
echo "# lnd service is stopped for security"
|
||||
echo "filename='${downloadPath}/lnd-rescue-${md5checksum}.tar.gz'"
|
||||
|
Loading…
x
Reference in New Issue
Block a user