Delete old backups from gitlab

I have configured gitlab.rb file and reconfigured gitlab server gitlab-ctl reconfigure to apply configuration changes:

I generated a gitlab backup with the following command:

gitlab-backup create

In the firts try, 6 old backups have been deleted. However, I have more backups in etc/gitlab/config_backup folder. I have made a second try with the backup creation command and it did not delete any old backup:

In etc/gitlab/config_backup folder lot of old backups still remain:

BTW, the date configuration of the server is correct:

irudia

What can I do in order to delete all the old backups? Do I need to remove them manually?

Hi, the config backups are deleted after the time set in /etc/gitlab/gitlab.rb by this value:

gitlab_rails['backup_keep_time'] = 604800

since this is in seconds, I think that is about 7 days. So it should delete. Otherwise, you can use a script like in this post: Remove files at /var/opt/gitlab/backups - #2 by iwalker

Effectively from that script just change this line:

GITLABBACKUPS=/var/opt/gitlab/backups

so change /var/opt/gitlab/backups to /etc/gitlab/config_backup and then run the script once a week or daily.

2 Likes

OK. Thanks!