From 497042ddf2e56ae0f130434f2f44135d584c7354 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 27 Jan 2015 08:25:32 +1100 Subject: [PATCH] FIX: don't restrict to local filesystem for df check FIX: check correct directory when looking at backup limits --- app/controllers/admin/backups_controller.rb | 2 +- lib/cooked_post_processor.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/backups_controller.rb b/app/controllers/admin/backups_controller.rb index 3a3ae1b1c2e..a80e1b924d4 100644 --- a/app/controllers/admin/backups_controller.rb +++ b/app/controllers/admin/backups_controller.rb @@ -137,7 +137,7 @@ class Admin::BackupsController < Admin::AdminController private def has_enough_space_on_disk?(size) - `df -Pk . | awk 'NR==2 {print $4 * 1024;}'`.to_i > size + `df -Pk #{Rails.root}/public/backups | awk 'NR==2 {print $4 * 1024;}'`.to_i > size end end diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb index 77dcb8d1df8..e58f17bd17e 100644 --- a/lib/cooked_post_processor.rb +++ b/lib/cooked_post_processor.rb @@ -264,7 +264,7 @@ class CookedPostProcessor end def available_disk_space - 100 - `df -l #{Rails.root}/public/uploads | tail -1 | tr -s ' ' | cut -d ' ' -f 5`.to_i + 100 - `df -P #{Rails.root}/public/uploads | tail -1 | tr -s ' ' | cut -d ' ' -f 5`.to_i end def dirty?