Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
75068d86
Commit
75068d86
authored
Nov 10, 2021
by
Zhu Shung
Committed by
Lin Jen-Shin
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method backup_file?
parent
fd23cb31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
lib/backup/manager.rb
lib/backup/manager.rb
+9
-2
No files found.
lib/backup/manager.rb
View file @
75068d86
...
@@ -99,9 +99,10 @@ module Backup
...
@@ -99,9 +99,10 @@ module Backup
# - 1495527122_gitlab_backup.tar
# - 1495527122_gitlab_backup.tar
# - 1495527068_2017_05_23_gitlab_backup.tar
# - 1495527068_2017_05_23_gitlab_backup.tar
# - 1495527097_2017_05_23_9.3.0-pre_gitlab_backup.tar
# - 1495527097_2017_05_23_9.3.0-pre_gitlab_backup.tar
next
unless
file
=~
/^(\d{10})(?:_\d{4}_\d{2}_\d{2}(_\d+\.\d+\.\d+((-|\.)(pre|rc\d))?(-ee)?)?)?_gitlab_backup\.tar$/
matched
=
backup_file?
(
file
)
next
unless
matched
timestamp
=
Regexp
.
last_match
(
1
)
.
to_i
timestamp
=
matched
[
1
]
.
to_i
if
Time
.
at
(
timestamp
)
<
(
Time
.
now
-
keep_time
)
if
Time
.
at
(
timestamp
)
<
(
Time
.
now
-
keep_time
)
begin
begin
...
@@ -192,6 +193,10 @@ module Backup
...
@@ -192,6 +193,10 @@ module Backup
private
private
def
backup_file?
(
file
)
file
.
match
(
/^(\d{10})(?:_\d{4}_\d{2}_\d{2}(_\d+\.\d+\.\d+((-|\.)(pre|rc\d))?(-ee)?)?)?_gitlab_backup\.tar$/
)
end
def
non_tarred_backup?
def
non_tarred_backup?
File
.
exist?
(
File
.
join
(
backup_path
,
'backup_information.yml'
))
File
.
exist?
(
File
.
join
(
backup_path
,
'backup_information.yml'
))
end
end
...
@@ -314,3 +319,5 @@ module Backup
...
@@ -314,3 +319,5 @@ module Backup
end
end
end
end
end
end
Backup
::
Manager
.
prepend_mod
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment