I use the rake task to create backups for GitLab 6.8.2.
gitlab-rake gitlab:backup:create
In /etc/gitlab/gitlab.rb
I added the following line:
gitlab_rails['backup_keep_time'] = 60
This is supposed to prune backups older than 60 seconds. My expectation was that a second run of gitlab:backup:create
would remove the first backup if 60 seconds have passed. Though the last line in the output is
Deleting old backups ... skipping
How do I configure GitLab to actually remove old backups?
The option you want is
gitlab_rails['backup_keep_time']
. I had toafter setting it for it to have any effect. Note that it will only affect local backups, not Amazon-AWS S3 if you're using that.
There was an issue with them being ignored, but I'm not sure what versions it affects. Version 6 is pretty old. If you're on the omnibus, it might be worth an upgrade.
Perhaps you are looking at rotating out stale files in the remote or
backup_upload_connection
folder. Gitlab is not able to remove stale backups from this or any other remote locations. Thebackup_keep_time
is only for its internalbackup_path
which is defaulted to/var/opt/gitlab/backups
.I am planning to run a cron job separately which deletes all but 10 of the newest files in my remote, NFS mounted, backup folder.
See this merge request: https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1453
And this diff: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5567/diffs