mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-19 12:10:33 +02:00
hide path check from output
This commit is contained in:
@@ -142,16 +142,16 @@ elif [ "$1" = backup-compact ];then
|
|||||||
dbPath="/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3"
|
dbPath="/home/bitcoin/.lightning/${CLNETWORK}/lightningd.sqlite3"
|
||||||
backupPath="/home/bitcoin/${netprefix}lightningd.sqlite3.backup"
|
backupPath="/home/bitcoin/${netprefix}lightningd.sqlite3.backup"
|
||||||
|
|
||||||
if sudo ls "${dbPath}"; then
|
if sudo ls "${dbPath}" >/dev/null; then
|
||||||
dbSize=$(sudo du -m "${dbPath}" | awk '{print $1}')
|
dbSize=$(sudo du -m "${dbPath}" | awk '{print $1}')
|
||||||
echo "$dbSize MB $dbPath"
|
echo "$dbSize MB $dbPath"
|
||||||
backupSize=$(sudo du -m ${backupPath} | awk '{print $1}')
|
backupSize=$(sudo du -m "${backupPath}" | awk '{print $1}')
|
||||||
echo "$backupSize MB $backupPath"
|
echo "$backupSize MB $backupPath"
|
||||||
if [ "$backupSize" -gt $((dbSize+200)) ] ; then
|
if [ "$backupSize" -gt $((dbSize+200)) ] ; then
|
||||||
echo "# The backup is 200MB+ larger than the db, running '${netprefix}lightning-cli backup-compact' ..."
|
echo "# The backup is 200MB+ larger than the db, running '${netprefix}lightning-cli backup-compact' ..."
|
||||||
$lightningcli_alias backup-compact
|
$lightningcli_alias backup-compact
|
||||||
else
|
else
|
||||||
echo "The backup is not significantly larger than the db, there's no need to compact."
|
echo "The backup is not significantly larger than the db, there is no need to compact."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "# No ${dbPath} is present"
|
echo "# No ${dbPath} is present"
|
||||||
|
Reference in New Issue
Block a user