summaryrefslogtreecommitdiff
path: root/gitlab-server/usr/share/gitlab-install/backup-gitlab
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-05-21 10:52:06 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-05-21 10:52:06 +0000
commit47f8006f6c1635d8b1af216b65e4a99a707caa66 (patch)
tree460584a7fc05c5e8c92dccaf3b8e86e88e462461 /gitlab-server/usr/share/gitlab-install/backup-gitlab
parent2d7145be1ea96d345b494da30291a4f5eb1c922c (diff)
parentcd86b155042f6fca18c231b862d8e923eb38b441 (diff)
downloaddefinitions-47f8006f6c1635d8b1af216b65e4a99a707caa66.tar.gz
Merge remote-tracking branch 'origin/baserock/liw/gitlab-backup-cronjob'
Reviewed-by: Daniel Silverstone (email) Reviewed-by: Richard Maw (irc)
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 00000000..a6c3e3f5
--- /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