FIX: BackupRestore::Backuper#remove_tar_leftovers not cleaning up files.

Wildcard is sanitized when passed to `system()`.
This commit is contained in:
Guo Xiang Tan 2018-07-04 13:57:22 +08:00
parent 9cc7df13a4
commit 0af159546a

View File

@ -30,7 +30,7 @@ module BackupRestore
enable_readonly_mode enable_readonly_mode
pause_sidekiq pause_sidekiq
wait_for_sidekiq wait_for_sidekiqz
dump_public_schema dump_public_schema
@ -281,7 +281,7 @@ module BackupRestore
def remove_tar_leftovers def remove_tar_leftovers
log "Removing '.tar' leftovers..." log "Removing '.tar' leftovers..."
system('rm', '-f', "#{@archive_directory}/*.tar") Dir["#{@archive_directory}/*.tar"].each { |filename| File.delete(filename) }
end end
def remove_tmp_directory def remove_tmp_directory