Commit 55a662e0c94d19cc09bcec7a2701252cfa1e1450

Authored by Sytse Sijbrandij
2 parents 8695ab28 5e2ccc67

Merge branch 'backup_crontab' into 'master'

Backup Crontab
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 +```