Skip to content

Instantly share code, notes, and snippets.

@zealot128
Created October 18, 2016 20:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save zealot128/3585c0cdb621945e94b867bd14c4ea5e to your computer and use it in GitHub Desktop.
Save zealot128/3585c0cdb621945e94b867bd14c4ea5e to your computer and use it in GitHub Desktop.
Omnibus Gitlab backup cronjob
# Crontab
# once per week backup, move to "/backup" gzip it, delete everything but the latest 5 files
0 4 * * 1 /opt/gitlab/bin/gitlab-ci-rake gitlab:backup:create CRON=1 && mv /var/opt/gitlab/backups/* /backup/ && cd /backup && gzip *.tar && rm `ls -t | awk 'NR>5'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment