FIX: don't restrict to local filesystem for df check

FIX: check correct directory when looking at backup limits
This commit is contained in:
Sam 2015-01-27 08:25:32 +11:00
parent 20411649e1
commit 497042ddf2
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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?