Created
February 2, 2022 11:07
-
-
Save travelhawk/2f2bc3a82ecd2acd037157025268ea49 to your computer and use it in GitHub Desktop.
Crontab with maintainence tasks for self-managed GitLab instance (docker setup)
This file contains hidden or 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 for Self-Managed GitLab instance | |
# ---------------------------------------- | |
# Edit with (sudo) crontab -e | |
## mail errors to email | |
[email protected] | |
## prune unused image to reduce space | |
@daily docker image prune -f > /dev/null | |
## daily gitlab backup at night (app & config/secrets) | |
0 2 * * * docker exec -t gitlab_web_1 gitlab-backup create > /dev/null | |
0 3 * * * docker exec -t gitlab_web_1 gitlab-ctl backup-etc --delete-old-backups > /dev/null | |
## upload backup to backup server | |
0 4 * * * cd /home/htects/gitlab && ./upload_backups.sh > /dev/null | |
## remove unused docker layers in GitLab (every sunday) | |
30 4 * * 0 docker exec -t gitlab_web_1 gitlab-ctl registry-garbage-collect -m |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment