我如何让GitLab删除旧的备份?

我使用rake任务为GitLab 6.8.2创build备份

gitlab-rake gitlab:backup:create 

/etc/gitlab/gitlab.rb我添加了以下行:

 gitlab_rails['backup_keep_time'] = 60 

这应该修剪超过60秒的备份。 我的期望是,第二次运行gitlab:backup:create会在60秒内删除第一个备份。 尽pipe输出的最后一行是

删除旧的备份…跳过

我如何configurationGitLab去实际删除旧的备份?

你想要的选项是gitlab_rails['backup_keep_time'] 。 我不得不

gitlab-ctl reconfigure

设置后它有什么作用。 请注意,这只会影响本地备份,而不会影响Amazon-AWS S3。

有一个被忽略的问题, https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1453 ,但我不知道它影响了什么版本。 版本6是相当古老的。 如果你在综合方面,可能值得升级。

也许你正在寻找旋转远程backup_upload_connection文件夹中的陈旧文件。 Gitlab无法从这个或任何其他远程位置删除过时的备份。 backup_keep_time仅用于缺省为/var/opt/gitlab/backups内部backup_path

我正在计划单独运行一个cron作业,删除远程NFS挂载的备份文件夹中最新的10个文件。

 ls -dt */ | tail -n +11 | xargs rm -rf 

看到这个合并请求: https : //gitlab.com/gitlab-org/omnibus-gitlab/issues/1453

而这个差异: https : //gitlab.com/gitlab-org/gitlab-ce/merge_requests/5567/diffs

 Note that the `backup_keep_time` configuration option only manages local files. GitLab does not automatically prune old files stored in a third-party object storage (eg AWS S3) because the user may not have permission to list and delete files. We recommend that you configure the appropriate retention policy for your object storage. For example, you can configure [the S3 backup policy here as described here](http://stackoverflow.com/questions/37553070/gitlab-omnibus-delete-backup-from-amazon-s3).