Skip to content

A platform for community discussion. Free, open, simple.

FIX: Prevent scientific notation in free space check (#8473)

Blake Ericksonb73a133bb5bb
diff --git a/app/controllers/admin/backups_controller.rb b/app/controllers/admin/backups_controller.rb
index 9d52e669b5c..3eb3f627720 100644
--- a/app/controllers/admin/backups_controller.rb
+++ b/app/controllers/admin/backups_controller.rb
@@ -215,7 +215,7 @@ class Admin::BackupsController < Admin::AdminController
private
def has_enough_space_on_disk?(size)
- `df -Pk #{Rails.root}/public/backups | awk 'NR==2 {print $4 * 1024;}'`.to_i > size
+ `df -Pk #{Rails.root}/public/backups | awk 'NR==2 {printf "%.0f", $4 * 1024;}'`.to_i > size
end
def ensure_backups_enabled