我使用rake任务为GitLab 6.8.2创建备份。
gitlab-rake gitlab:backup:create
在/etc/gitlab/gitlab.rb
中,我添加了以下行:
gitlab_rails['backup_keep_time'] = 60
这应该是对60秒以上的备份进行修剪。我的期望是,如果60秒过去,第二次运行gitlab:backup:create
将删除第一个备份。虽然输出中的最后一行是
删除旧备份..。跳过
如何配置GitLab以实际删除旧备份?
发布于 2016-09-09 16:29:42
您想要的选项是gitlab_rails['backup_keep_time']
。我不得不
gitlab-ctl reconfigure
在设置好后才能产生任何效果。请注意,它只会影响本地备份,而不是Amazon S3,如果您正在使用该备份。
有他们被忽视的问题,但我不确定它会影响什么版本。第6版很老了。如果你在公共汽车上,这可能是值得升级的。
发布于 2017-01-25 21:16:16
也许您正在考虑在远程或backup_upload_connection
文件夹中旋转过时的文件。Gitlab无法从此或任何其他远程位置删除过时的备份。backup_keep_time
只针对其内部backup_path
(默认为/var/opt/gitlab/backups
)。
我计划单独运行一个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_请求/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 (e.g. 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).
https://serverfault.com/questions/791797
复制相似问题