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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
cef76fdd
Commit
cef76fdd
authored
May 08, 2013
by
Lev Abalkin
Committed by
Alexander Belopolsky
May 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save backup time as is. Fixes #3857.
parent
7357ebc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
lib/tasks/gitlab/backup.rake
lib/tasks/gitlab/backup.rake
+3
-4
No files found.
lib/tasks/gitlab/backup.rake
View file @
cef76fdd
...
@@ -11,12 +11,11 @@ namespace :gitlab do
...
@@ -11,12 +11,11 @@ namespace :gitlab do
Rake
::
Task
[
"gitlab:backup:repo:create"
].
invoke
Rake
::
Task
[
"gitlab:backup:repo:create"
].
invoke
Rake
::
Task
[
"gitlab:backup:uploads:create"
].
invoke
Rake
::
Task
[
"gitlab:backup:uploads:create"
].
invoke
current_time
=
Time
.
now
# saving additional informations
# saving additional informations
s
=
{}
s
=
{}
s
[
:db_version
]
=
"
#{
ActiveRecord
::
Migrator
.
current_version
}
"
s
[
:db_version
]
=
"
#{
ActiveRecord
::
Migrator
.
current_version
}
"
s
[
:backup_created_at
]
=
current_time
s
[
:backup_created_at
]
=
Time
.
now
s
[
:gitlab_version
]
=
%x{git rev-parse HEAD}
.
gsub
(
/\n/
,
""
)
s
[
:gitlab_version
]
=
%x{git rev-parse HEAD}
.
gsub
(
/\n/
,
""
)
s
[
:tar_version
]
=
%x{tar --version | head -1}
.
gsub
(
/\n/
,
""
)
s
[
:tar_version
]
=
%x{tar --version | head -1}
.
gsub
(
/\n/
,
""
)
...
@@ -27,8 +26,8 @@ namespace :gitlab do
...
@@ -27,8 +26,8 @@ namespace :gitlab do
end
end
# create archive
# create archive
print
"Creating backup archive:
#{
current_time
.
to_i
}
_gitlab_backup.tar ... "
print
"Creating backup archive:
#{
s
[
:backup_created_at
]
.
to_i
}
_gitlab_backup.tar ... "
if
Kernel
.
system
(
"tar -cf
#{
current_time
.
to_i
}
_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml"
)
if
Kernel
.
system
(
"tar -cf
#{
s
[
:backup_created_at
]
.
to_i
}
_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml"
)
puts
"done"
.
green
puts
"done"
.
green
else
else
puts
"failed"
.
red
puts
"failed"
.
red
...
...
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