Commit 450e2cd8 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

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.
parent 4c8d478e
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment