We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98e0ac3 commit b161ec5Copy full SHA for b161ec5
backup/gitlab_dump_and_restore/gitlab_restore.sh
@@ -1,6 +1,6 @@
1
#!/usr/bin/env bash
2
3
-# Restore GitLab dump data
+# Restore GitLab dump data.
4
# Copyright (c) December, 2018. Aleksandr Bazhenov
5
6
# This Source Code Form is subject to the terms of the BSD 3-Clause License.
@@ -12,5 +12,6 @@
12
13
sudo find /var/opt/gitlab/backups -mindepth 1 -exec rm -rf {} +
14
sudo chown git /var/opt/gitlab/backups
15
-sudo gitlab-rake gitlab:backup:restore "$(ls -1 "$BACKUP_DIR"/*.tar 2>/dev/null | sort | tail -n 1)" force=yes
+sudo gitlab-rake gitlab:backup:restore "$(find "$BACKUP_DIR" -maxdepth 1 -type f -name '*.tar' -print0 | sort -z |
16
+ tail -zn1 | tr -d '\0')" force=yes
17
sudo gitlab-ctl restart
0 commit comments