[英]How to find version of gitlab backup?
I have a backup of unknown gitlab version. 我有一个未知的gitlab版本的备份。 My partner assume it is created by gitlab version 6.0.2 But when I implement a gitlab version 6.0.2 I am still impossible to restore it because of mismatch version.
我的伙伴认为它是由gitlab版本6.0.2创建的。但是当我实现gitlab版本6.0.2时,由于版本不匹配,我仍然无法恢复它。 So how do I get exactly version of a gitlab backup ?
那么如何获得gitlab备份的确切版本呢?
Inside the tar archive there is a file called backup_information.yml
. 在tar存档中有一个名为
backup_information.yml
的文件。 There lies the info you are looking for. 您正在寻找的信息。 To find the version number:
要查找版本号:
tar xf 1411831804_gitlab_backup.tar -O backup_information.yml | grep gitlab_version | awk '{print $2}'
Where 1411831804_gitlab_backup.tar
the archive in question. 1411831804_gitlab_backup.tar
存档有问题。
You could also make a simple script and loop over the backup folder like so: 您还可以创建一个简单的脚本并循环遍历备份文件夹,如下所示:
for archive in $(find /home/git/gitlab/tmp/backups -name '*.tar'); do echo -ne "$archive - $(tar tf $archive backup_information.yml | grep gitlab_version | awk '{print $2}')\n"; done
Where /home/git/gitlab/tmp/backups
is the path to the backup directory. 其中
/home/git/gitlab/tmp/backups
是备份目录的路径。 For Omnibus GitLab it is /var/opt/gitlab/backups
. 对于Omnibus GitLab,它是
/var/opt/gitlab/backups
。
But yeah, the tar name should be more descriptive. 但是,tar名称应该更具描述性。 As a matter of fact, I was thinking the same some time ago when I migrated to a packaged installation.
事实上,我在迁移到打包安装时不久前也在考虑这个问题。 Will submit a patch.
将提交补丁。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.