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
Kazuhiko Shiozaki
gitlab-ce
Commits
54e40241
Commit
54e40241
authored
Mar 01, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'backup_uploads_symlink' into 'master'
Backup Uploads Symlink
parents
b97536a5
a47a6f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
lib/backup/uploads.rb
lib/backup/uploads.rb
+3
-2
No files found.
lib/backup/uploads.rb
View file @
54e40241
...
...
@@ -3,7 +3,7 @@ module Backup
attr_reader
:app_uploads_dir
,
:backup_uploads_dir
,
:backup_dir
def
initialize
@app_uploads_dir
=
Rails
.
root
.
join
(
'public'
,
'uploads'
)
@app_uploads_dir
=
File
.
realpath
(
Rails
.
root
.
join
(
'public'
,
'uploads'
)
)
@backup_dir
=
Gitlab
.
config
.
backup
.
path
@backup_uploads_dir
=
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'uploads'
)
end
...
...
@@ -21,8 +21,9 @@ module Backup
end
def
backup_existing_uploads_dir
timestamped_uploads_path
=
File
.
join
(
app_uploads_dir
,
'..'
,
"uploads.
#{
Time
.
now
.
to_i
}
"
)
if
File
.
exists?
(
app_uploads_dir
)
FileUtils
.
mv
(
app_uploads_dir
,
Rails
.
root
.
join
(
'public'
,
"uploads.
#{
Time
.
now
.
to_i
}
"
)
)
FileUtils
.
mv
(
app_uploads_dir
,
timestamped_uploads_path
)
end
end
end
...
...
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