Commit 5cdfd51e authored by Kirill Smelkov's avatar Kirill Smelkov

gitlab-backup: Make $tmpd absolute

For now having $tmpd worked ok, but in the next patch, we are going to
pass this directory to a command, which, when run, automatically changes
its working directory as a first step, so passing $tmpd as relative
pathname won't work for it.

So switch $tmpd to be an absolute path.

/cc @kazuhiko
parent 8099a8bf
...@@ -49,7 +49,7 @@ backup_pull() { ...@@ -49,7 +49,7 @@ backup_pull() {
# 1. dump all gitlab data except repositories # 1. dump all gitlab data except repositories
echo " * Dumping gitlab data (except repositories)" echo " * Dumping gitlab data (except repositories)"
tmpd=`mktemp -d gitlab-backup.XXXXXX` tmpd=$(mktemp -d `pwd`/gitlab-backup.XXXXXX)
gitlab-rake gitlab:backup:create SKIP=repositories | tee "$tmpd/gitlab_backup_create.out" gitlab-rake gitlab:backup:create SKIP=repositories | tee "$tmpd/gitlab_backup_create.out"
backup_tar=`grep "^Creating backup archive: .* done" "$tmpd/gitlab_backup_create.out"` || \ backup_tar=`grep "^Creating backup archive: .* done" "$tmpd/gitlab_backup_create.out"` || \
die "E: Cannot detect backup tar" die "E: Cannot detect backup tar"
...@@ -98,7 +98,7 @@ backup_restore() { ...@@ -98,7 +98,7 @@ backup_restore() {
# 1. extract all gitlab data except repositories # 1. extract all gitlab data except repositories
echo " * Extracting gitlab data (except repositories)" echo " * Extracting gitlab data (except repositories)"
tmpd=`mktemp -d gitlab-backup.XXXXXX` tmpd=$(mktemp -d `pwd`/gitlab-backup.XXXXXX)
$GIT_BACKUP restore $HEAD gitlab/misc:"$tmpd/gitlab_backup" $GIT_BACKUP restore $HEAD gitlab/misc:"$tmpd/gitlab_backup"
gzip "$tmpd/gitlab_backup/db/database.sql" # gzip sql dump, as gitlab expects .gz gzip "$tmpd/gitlab_backup/db/database.sql" # gzip sql dump, as gitlab expects .gz
......
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