hide path check from output

This commit is contained in:
openoms
2022-01-06 18:59:45 +00:00
parent bec5b9b965
commit 4fcdbe71db

View File

@@ -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"