1
0
Fork 0

Check free storage before upgrading

This commit is contained in:
Felix Ableitner 2018-11-22 15:40:49 +01:00 committed by Chocobozzz
parent b6ff69719d
commit 7593929170
1 changed files with 8 additions and 0 deletions

View File

@ -20,6 +20,14 @@ if [ ! -e "$PEERTUBE_PATH/versions" -o ! -e "$PEERTUBE_PATH/config/production.ya
exit 1
fi
REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p)
ONE_GB=$((1024 * 1024))
if [ "$REMAINING" -lt "$ONE_GB" ]; then
echo "Error - not enough free space for upgrading"
echo ""
echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH"
exit 1
fi
# Backup database
SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak"