Created
October 18, 2016 20:42
-
-
Save zealot128/3585c0cdb621945e94b867bd14c4ea5e to your computer and use it in GitHub Desktop.
Omnibus Gitlab backup cronjob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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