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
Tatuya Kamada
gitlab-ce
Commits
e8b963fc
Commit
e8b963fc
authored
May 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3858 from abalkin/issue-3857
Save backup time as is. Fixes #3857.
parents
81e60294
cef76fdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
lib/tasks/gitlab/backup.rake
lib/tasks/gitlab/backup.rake
+4
-3
No files found.
lib/tasks/gitlab/backup.rake
View file @
e8b963fc
...
@@ -11,10 +11,11 @@ namespace :gitlab do
...
@@ -11,10 +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
# 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
]
=
"
#{
Time
.
now
}
"
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/
,
""
)
...
@@ -25,8 +26,8 @@ namespace :gitlab do
...
@@ -25,8 +26,8 @@ namespace :gitlab do
end
end
# create archive
# create archive
print
"Creating backup archive:
#{
Time
.
now
.
to_i
}
_gitlab_backup.tar ... "
print
"Creating backup archive:
#{
s
[
:backup_created_at
]
.
to_i
}
_gitlab_backup.tar ... "
if
Kernel
.
system
(
"tar -cf
#{
Time
.
now
.
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