diff options
author | Felix Ableitner <me@nutomic.com> | 2018-11-22 15:40:49 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-12-04 09:31:36 +0100 |
commit | 75939291703cf18010495f6b85d6d65e01184235 (patch) | |
tree | 02bc7f2deda9c9efc6785d0dd936612d52d3650b /scripts/upgrade.sh | |
parent | b6ff69719d7905c1c62c193d34fca3eb27e982fb (diff) | |
download | PeerTube-75939291703cf18010495f6b85d6d65e01184235.tar.gz PeerTube-75939291703cf18010495f6b85d6d65e01184235.tar.zst PeerTube-75939291703cf18010495f6b85d6d65e01184235.zip |
Check free storage before upgrading
Diffstat (limited to 'scripts/upgrade.sh')
-rwxr-xr-x | scripts/upgrade.sh | 8 |
1 files changed, 8 insertions, 0 deletions
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 | |||
20 | exit 1 | 20 | exit 1 |
21 | fi | 21 | fi |
22 | 22 | ||
23 | REMAINING=$(df -k $PEERTUBE_PATH | awk '{ print $4}' | sed -n 2p) | ||
24 | ONE_GB=$((1024 * 1024)) | ||
25 | if [ "$REMAINING" -lt "$ONE_GB" ]; then | ||
26 | echo "Error - not enough free space for upgrading" | ||
27 | echo "" | ||
28 | echo "Make sure you have at least 1 GB of free space in $PEERTUBE_PATH" | ||
29 | exit 1 | ||
30 | fi | ||
23 | 31 | ||
24 | # Backup database | 32 | # Backup database |
25 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" | 33 | SQL_BACKUP_PATH="$PEERTUBE_PATH/backup/sql-peertube_prod-$(date +"%Y%m%d-%H%M").bak" |