Skip to content

Instantly share code, notes, and snippets.

@cyriac
Created May 23, 2014 20:15
Show Gist options
  • Save cyriac/31dbb186fad3337874e7 to your computer and use it in GitHub Desktop.
Save cyriac/31dbb186fad3337874e7 to your computer and use it in GitHub Desktop.
Gitlab backup to Amazon S3
0 2 * * * cd /home/git/gitlab && PATH=/usr/local/bin:/usr/bin:/bin bundle exec rake gitlab:backup:create RAILS_ENV=production
0 4 * * * s3cmd sync --skip-existing --delete-removed /home/git/gitlab/tmp/backups/ s3://<backup-bucket-name>/gitlab/
@seancdavis
Copy link

Works nicely!

GitLab suggests you run the initial command as the git user (assuming you've installed per their instructions). This works for me:

cd /home/git/gitlab && sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment