Fix free disk space calculation take 2
authorRafael dos Santos Silva <xfalcox@gmail.com>
Tue, 12 May 2020 22:16:00 +0000 (19:16 -0300)
committerRafael dos Santos Silva <xfalcox@gmail.com>
Tue, 12 May 2020 22:16:00 +0000 (19:16 -0300)
templates/postgres.template.yml

index 052825684a8ee212dc2534edbb2f00fb1fcca28e..3f642de16d52ee8b8632d9a0227b72e71dc93bec 100644 (file)
@@ -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