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
c5aae307
Commit
c5aae307
authored
Jul 29, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set internal backup directory modes on create
This sidesteps problems with running 'chmod' on some CIFS mounts.
parent
5efb58b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
5 deletions
+3
-5
lib/backup/database.rb
lib/backup/database.rb
+1
-1
lib/backup/manager.rb
lib/backup/manager.rb
+0
-2
lib/backup/repository.rb
lib/backup/repository.rb
+1
-1
lib/backup/uploads.rb
lib/backup/uploads.rb
+1
-1
No files found.
lib/backup/database.rb
View file @
c5aae307
...
...
@@ -7,7 +7,7 @@ module Backup
def
initialize
@config
=
YAML
.
load_file
(
File
.
join
(
Rails
.
root
,
'config'
,
'database.yml'
))[
Rails
.
env
]
@db_dir
=
File
.
join
(
Gitlab
.
config
.
backup
.
path
,
'db'
)
FileUtils
.
mkdir_p
(
@db_dir
)
unless
Dir
.
exists?
(
@db_dir
)
FileUtils
.
mkdir_p
(
@db_dir
,
mode:
0700
)
unless
Dir
.
exists?
(
@db_dir
)
end
def
dump
...
...
lib/backup/manager.rb
View file @
c5aae307
...
...
@@ -16,8 +16,6 @@ module Backup
file
<<
s
.
to_yaml
.
gsub
(
/^---\n/
,
''
)
end
FileUtils
.
chmod
(
0700
,
folders_to_backup
)
# create archive
$progress
.
print
"Creating backup archive:
#{
tar_file
}
... "
orig_umask
=
File
.
umask
(
0077
)
...
...
lib/backup/repository.rb
View file @
c5aae307
...
...
@@ -130,7 +130,7 @@ module Backup
def
prepare
FileUtils
.
rm_rf
(
backup_repos_path
)
FileUtils
.
mkdir_p
(
backup_repos_path
)
FileUtils
.
mkdir_p
(
backup_repos_path
,
mode:
0700
)
end
def
silent
...
...
lib/backup/uploads.rb
View file @
c5aae307
...
...
@@ -10,7 +10,7 @@ module Backup
# Copy uploads from public/uploads to backup/uploads
def
dump
FileUtils
.
mkdir_p
(
backup_uploads_dir
)
FileUtils
.
mkdir_p
(
backup_uploads_dir
,
mode:
0700
)
FileUtils
.
cp_r
(
app_uploads_dir
,
backup_dir
)
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