summaryrefslogtreecommitdiff
path: root/gitlab-server/usr/share/gitlab-install/backup-gitlab
blob: a6c3e3f5b504215b1b375532c8154d34e456b344 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# Run the gitlab backup script. The backup will be stored as
# /home/git/gitlab-backup.tar . A separate backup host will need to
# back that up.
#
# This script be run as the git user on a GitLab host.

set -e

export PATH=/usr/local/bin:/usr/bin:/bin

cd /home/git/gitlab
mkdir -p /home/git/gitlab/tmp/backups
bundle exec rake gitlab:backup:create RAILS_ENV=production

ls /home/git/gitlab/tmp/backups/[0-9]*.tar |
tail -n1 |
while read filename
do
    mv "$filename" /home/git/gitlab-backup.tar
done