diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-05-23 10:20:54 +0200 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-05-23 10:23:04 +0200 |
commit | 450e2cd879d2e819f084dd3940cf19a9521c2611 (patch) | |
tree | 7305854c9cd52d7a64ffc507984c44d9fb43a469 /lib/backup | |
parent | 4c8d478eefc4b50ffc26f0d1ce159470ae9f0105 (diff) | |
download | gitlab-ce-450e2cd879d2e819f084dd3940cf19a9521c2611.tar.gz |
Add missing regex to backup manager
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10901/diffs
introduced a new naming scheme for backups, but the code which
cleans up old backups wasn't updated accordingly. In order to
maintain backward compatibility, we need to account for 3 naming
schemes.
Diffstat (limited to 'lib/backup')
-rw-r--r-- | lib/backup/manager.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb index 330cd963626..e8e0e2f07d4 100644 --- a/lib/backup/manager.rb +++ b/lib/backup/manager.rb @@ -84,7 +84,12 @@ module Backup Dir.chdir(backup_path) do backup_file_list.each do |file| - next unless file =~ /(\d+)(?:_\d{4}_\d{2}_\d{2})?_gitlab_backup\.tar/ + + # For backward compatibility, there are 3 names the backups can have: + # - 1495527122_gitlab_backup.tar + # - 1495527068_2017_05_23_gitlab_backup.tar + # - 1495527097_2017_05_23_9.3.0-pre_gitlab_backup.tar + next unless file =~ /(\d+)(?:_\d{4}_\d{2}_\d{2}(_\d+\.\d+\.\d+.*)?)?_gitlab_backup\.tar$/ timestamp = $1.to_i |