mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: New site setting to enable a daily automatic backup
This commit is contained in:
14
app/jobs/scheduled/create_backup.rb
Normal file
14
app/jobs/scheduled/create_backup.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
require_dependency "backup_restore"
|
||||
|
||||
module Jobs
|
||||
class CreateBackup < Jobs::Scheduled
|
||||
every 1.day
|
||||
sidekiq_options retry: false
|
||||
|
||||
def execute(args)
|
||||
return unless SiteSetting.backup_daily?
|
||||
BackupRestore.backup!(Discourse.system_user.id, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user