Skip to content

Instantly share code, notes, and snippets.

@rajamodu
Forked from zealot128/crontab.cron
Created January 10, 2022 13:38
Show Gist options
  • Select an option

  • Save rajamodu/7cb5cea29f62079e4109d938337fb658 to your computer and use it in GitHub Desktop.

Select an option

Save rajamodu/7cb5cea29f62079e4109d938337fb658 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