FIX: don't restrict to local filesystem for df check
FIX: check correct directory when looking at backup limits
This commit is contained in:
parent
20411649e1
commit
497042ddf2
|
@ -137,7 +137,7 @@ class Admin::BackupsController < Admin::AdminController
|
||||||
private
|
private
|
||||||
|
|
||||||
def has_enough_space_on_disk?(size)
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -264,7 +264,7 @@ class CookedPostProcessor
|
||||||
end
|
end
|
||||||
|
|
||||||
def available_disk_space
|
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
|
end
|
||||||
|
|
||||||
def dirty?
|
def dirty?
|
||||||
|
|
Loading…
Reference in New Issue