Try to meet several review comments

parent ab8372d2
......@@ -273,15 +273,16 @@ sudo -u git -H bundle exec rake gitlab:backup:create SKIP=db,uploads RAILS_ENV=p
### Skipping tar creation
The last part of backup creation is generation of a tar file with all
the parts in. In some cases (e.g. if the backup is picked up by other
backup software) that might be wasted or even directly harmful, you can
skip this step by adding `tar` to the `SKIP` environment variable.
The last part of creating a backup is generation of a `.tar` file containing
all the parts. In some cases (for example, if the backup is picked up by other
backup software) creating a `.tar` file might be wasted effort or even directly
harmful, so you can skip this step by adding `tar` to the `SKIP` environment
variable.
This will leave the files and directories containing the backup in the
directory used for the intermediate files, and thus the will be
overwritten when a new backup is created, i.e. you can't have more than
one backup on the system, so you should make sure it's copied elsewhere.
Including `tar` in the `SKIP` variable will leave the files and directories
containing the backup in the directory used for the intermediate files. These
files will be overwritten when a new backup is created, so you should make sure
it's copied elsewhere, because you can only have one backup on the system.
For Omnibus GitLab packages:
......@@ -289,9 +290,6 @@ For Omnibus GitLab packages:
sudo gitlab-backup create SKIP=tar
```
NOTE: **Note**
For GitLab 12.1 and earlier, use `gitlab-rake gitlab:backup:create`.
For installations from source:
```shell
......@@ -685,8 +683,9 @@ lose access to your GitLab server.
You may also want to restore any TLS keys, certificates, or [SSH host keys](https://superuser.com/questions/532040/copy-ssh-keys-from-one-server-to-another-server/532079#532079).
If an untarred backup (like the ones made with `SKIP=tar`) is found, and
no backup is chosen with `BACKUP=<timestamp>`, the untarred is used.
Starting with GitLab12.9 if an untarred backup (like the ones made with
`SKIP=tar`) is found, and no backup is chosen with `BACKUP=<timestamp>`, the
untarred backup is used.
Depending on your case, you might want to run the restore command with one or
more of the following options:
......
......@@ -24,9 +24,6 @@ module Backup
end
def pack
# Make sure there is a connection
ActiveRecord::Base.connection.reconnect!
Dir.chdir(backup_path) do
# create archive
progress.print "Creating backup archive: #{tar_file} ... "
......@@ -113,9 +110,10 @@ module Backup
# rubocop: disable Metrics/AbcSize
def unpack
cleanup_required = true
Dir.chdir(backup_path) do
if ENV['BACKUP'].present?
# User has indicated which backup he/she wants restored
# User has indicated which backup to restore
tar_file = File.basename(ENV['BACKUP']) + FILE_NAME_SUFFIX
unless File.exist?(tar_file)
......
......@@ -19,13 +19,13 @@ namespace :gitlab do
backup = Backup::Manager.new(progress)
backup.write_info
if !(ENV['SKIP'] && ENV['SKIP'].include?('tar'))
if ENV['SKIP'] && ENV['SKIP'].include?('tar')
backup.upload
else
backup.pack
backup.upload
backup.cleanup
backup.remove_old
else
backup.upload
end
progress.puts "Warning: Your gitlab.rb and gitlab-secrets.json files contain sensitive data \n" \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment