From: Felix Ableitner Date: Thu, 22 Nov 2018 14:40:49 +0000 (+0100) Subject: Check free storage before upgrading X-Git-Tag: v1.2.0-rc.1~119 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=75939291703cf18010495f6b85d6d65e01184235;p=oweals%2Fpeertube.git Check free storage before upgrading --- diff --git a/scripts/upgrade.sh b/scripts/upgrade.sh index c70b3b42a..0a9ce1dab 100755 --- a/scripts/upgrade.sh +++ b/scripts/upgrade.sh @@ -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"