mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-22 05:11:50 +00:00
feat: hacer limpieza de emergencia #12854
This commit is contained in:
parent
63e55f16af
commit
28c51cab01
3 changed files with 7 additions and 3 deletions
1
Procfile
1
Procfile
|
@ -1,2 +1,3 @@
|
||||||
cleanup: bundle exec rake cleanup:everything
|
cleanup: bundle exec rake cleanup:everything
|
||||||
stats: bundle exec rake stats:process_all
|
stats: bundle exec rake stats:process_all
|
||||||
|
emergency_cleanup: bundle exec rake cleanup:everything[7]
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
namespace :cleanup do
|
namespace :cleanup do
|
||||||
desc 'Cleanup sites'
|
desc 'Cleanup sites'
|
||||||
task everything: :environment do
|
task everything: :environment do |_, args|
|
||||||
before = ENV.fetch('BEFORE', '30').to_i.days.ago
|
CleanupJob.perform_later((args.extras.first || 30).to_i.days.ago)
|
||||||
CleanupJob.perform_later(before)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -13,3 +13,7 @@ check program stats
|
||||||
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
|
with path "/usr/bin/foreman run -f /srv/Procfile -d /srv stats" as uid "rails" gid "www-data"
|
||||||
every "0 1 * * *"
|
every "0 1 * * *"
|
||||||
if status != 0 then alert
|
if status != 0 then alert
|
||||||
|
|
||||||
|
check filesystem root with path /
|
||||||
|
if space usage > 80% for 5 times within 15 cycles then alert
|
||||||
|
if space usage > 90% for 5 cycles then exec "/usr/bin/foreman run -f /srv/Procfile -d /srv emergency_cleanup" as uid "rails" gid "www-data"
|
||||||
|
|
Loading…
Reference in a new issue