Skip to content

Commit b161ec5

Browse files
wip
1 parent 98e0ac3 commit b161ec5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backup/gitlab_dump_and_restore/gitlab_restore.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Restore GitLab dump data
3+
# Restore GitLab dump data.
44
# Copyright (c) December, 2018. Aleksandr Bazhenov
55

66
# This Source Code Form is subject to the terms of the BSD 3-Clause License.
@@ -12,5 +12,6 @@
1212

1313
sudo find /var/opt/gitlab/backups -mindepth 1 -exec rm -rf {} +
1414
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
15+
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
1617
sudo gitlab-ctl restart

0 commit comments

Comments
 (0)