From a92a925766b38e234fc8cbde56038dfe1ccb34d4 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Tue, 12 May 2020 19:16:00 -0300 Subject: [PATCH] Fix free disk space calculation take 2 --- templates/postgres.template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 0528256..3f642de 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -62,7 +62,7 @@ run: if [ ! "12" = "$PG_MAJOR_OLD" ]; then echo Upgrading PostgreSQL from version ${PG_MAJOR_OLD} to 12 - free_disk=$(df -P /shared | tail -n 1 | awk '{print $4}') + free_disk=$(df -P -B1 /shared | tail -n 1 | awk '{print $4}') required=$(($(du -sb /shared/postgres_data | awk '{print $1}') * 2)) if [ "$free_disk" -lt "$required" ]; then -- 2.25.1