FEATURE: remove any .tar leftovers when backing up

This commit is contained in:
Régis Hanol 2015-02-04 11:49:11 +01:00
parent aca05267cd
commit 49b02287dc
1 changed files with 6 additions and 0 deletions

View File

@ -283,6 +283,7 @@ module BackupRestore
def clean_up
log "Cleaning stuff up..."
remove_tar_leftovers
remove_tmp_directory
unpause_sidekiq
disable_readonly_mode if Discourse.readonly_mode?
@ -290,6 +291,11 @@ module BackupRestore
log "Finished!"
end
def remove_tar_leftovers
log "Removing '.tar' leftovers..."
`rm -f #{@archive_directory}/*.tar`
end
def remove_tmp_directory
log "Removing tmp '#{@tmp_directory}' directory..."
FileUtils.rm_rf(@tmp_directory) if Dir[@tmp_directory].present?