From 0af159546a6d580576380167c5ce3fb8ec0b9004 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 4 Jul 2018 13:57:22 +0800 Subject: [PATCH] FIX: `BackupRestore::Backuper#remove_tar_leftovers` not cleaning up files. Wildcard is sanitized when passed to `system()`. --- lib/backup_restore/backuper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/backup_restore/backuper.rb b/lib/backup_restore/backuper.rb index 491d2cf5c3b..b9f2a8a22c1 100644 --- a/lib/backup_restore/backuper.rb +++ b/lib/backup_restore/backuper.rb @@ -30,7 +30,7 @@ module BackupRestore enable_readonly_mode pause_sidekiq - wait_for_sidekiq + wait_for_sidekiqz dump_public_schema @@ -281,7 +281,7 @@ module BackupRestore def remove_tar_leftovers log "Removing '.tar' leftovers..." - system('rm', '-f', "#{@archive_directory}/*.tar") + Dir["#{@archive_directory}/*.tar"].each { |filename| File.delete(filename) } end def remove_tmp_directory