Commit 5e2ccc671b8ee1c4b70c504b5b964a8bac259cda

Authored by Jacob Vosmaer
1 parent 8695ab28

Add instructions for backups using cron

Showing 1 changed file with 15 additions and 0 deletions   Show diff stats
doc/raketasks/backup_restore.md
@@ -78,3 +78,18 @@ Restoring repositories: @@ -78,3 +78,18 @@ Restoring repositories:
78 - Restoring repository abcd... [DONE] 78 - Restoring repository abcd... [DONE]
79 Deleting tmp directories...[DONE] 79 Deleting tmp directories...[DONE]
80 ``` 80 ```
  81 +
  82 +### Configure cron to make daily backups
  83 +
  84 +```
  85 +cd /home/git/gitlab
  86 +sudo -u git -H editor config/gitlab.yml # Enable keep_time in the backup section to automatically delete old backups
  87 +sudo -u git crontab -e # Edit the crontab for the git user
  88 +```
  89 +
  90 +Add the following lines at the bottom:
  91 +
  92 +```
  93 +# Create a full backup of the GitLab repositories and SQL database every day at 2am
  94 +0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
  95 +```