OSDN Git Service

Add instructions for backups using cron
authorJacob Vosmaer <contact@jacobvosmaer.nl>
Mon, 27 Jan 2014 17:54:28 +0000 (18:54 +0100)
committerJacob Vosmaer <contact@jacobvosmaer.nl>
Mon, 27 Jan 2014 17:55:36 +0000 (18:55 +0100)
doc/raketasks/backup_restore.md

index d2da64f..bdff6ad 100644 (file)
@@ -78,3 +78,18 @@ Restoring repositories:
 - Restoring repository abcd... [DONE]
 Deleting tmp directories...[DONE]
 ```
+
+### Configure cron to make daily backups
+
+```
+cd /home/git/gitlab
+sudo -u git -H editor config/gitlab.yml # Enable keep_time in the backup section to automatically delete old backups
+sudo -u git crontab -e # Edit the crontab for the git user
+```
+
+Add the following lines at the bottom:
+
+```
+# Create a full backup of the GitLab repositories and SQL database every day at 2am
+0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
+```