summaryrefslogtreecommitdiff
path: root/gitlab-server/usr/share/gitlab-install/backup-gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab-server/usr/share/gitlab-install/backup-gitlab')
-rw-r--r--gitlab-server/usr/share/gitlab-install/backup-gitlab22
1 files changed, 22 insertions, 0 deletions
diff --git a/gitlab-server/usr/share/gitlab-install/backup-gitlab b/gitlab-server/usr/share/gitlab-install/backup-gitlab
new file mode 100644
index 0000000..a6c3e3f
--- /dev/null
+++ b/gitlab-server/usr/share/gitlab-install/backup-gitlab
@@ -0,0 +1,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