clearcase:仅备份所有视图中已修改的签出元素
仅所有视图中修改后的签出元素定期进行大小高效的备份对我们来说是一件好事,因为大量定义的动态/快照视图无法包含在每日备份策略中。
以下 ksh 代码接近我们动态视图所需的代码,但它简单地假设视图的配置规范文件中的第一行始终首先选择签出的元素 ( *element * CHECKEDOUT* )。一般来说,它不会很好地工作。
对于视图中的每个版本化文件,我们希望能够将其添加到备份列表中,仅如果它与为该视图选择的 VOB 中最后一个对应的版本化元素不同。 (仅当它已在视图中开发时)。
[该解决方案也必须对快照视图有效]
for CHECKEDOUT_FILE_IN_THE_VIEW in $( /usr/atria/bin/cleartool lsco -cview -avobs -short )
do
VERSIONED_FILE_NAME=$( /usr/atria/bin/cleartool describe -short ${CHECKEDOUT_FILE_IN_THE_VIEW} \
| sed -e's/CHECKEDOUT/LATEST/' )
if [ -f ${VERSIONED_FILE_NAME} ]; then
if [ -f ${CHECKEDOUT_FILE_IN_THE_VIEW} ]; then
diff -b ${CHECKEDOUT_FILE_IN_THE_VIEW} ${VERSIONED_FILE_NAME} > /dev/null
if [ $? -ne 0 ]; then
##-- The checked-out file in the view is different from the corresponding
##-- versioned element in the VOB. So it has to be added to the backup list.
echo "${VERSIONED_FILE_NAME}" >> ${F_LOG}
fi
fi
fi
done
有什么想法吗? TIA。 哈维尔·C.
Having a regular size-efficient backup for only the modified checkedout elements in all views would be a great thing for us, since a great deal of the defined dynamic/snapshot views cannot be included in the daily backup policy.
The following ksh code is near to what we would need for a dynamic view, but it trivially assumes that the first line in the config-spec file for the view always selects the checked-out element first ( *element * CHECKEDOUT* ). It will not work well in general.
For each versioned file in the view we would like to be able to add it to the backup list only if it is different from the last corresponding versioned element in the VOB that is selected for that view. (Only if it has been developed in the view).
[The solution would have to be valid for snapshot views also]
for CHECKEDOUT_FILE_IN_THE_VIEW in $( /usr/atria/bin/cleartool lsco -cview -avobs -short )
do
VERSIONED_FILE_NAME=$( /usr/atria/bin/cleartool describe -short ${CHECKEDOUT_FILE_IN_THE_VIEW} \
| sed -e's/CHECKEDOUT/LATEST/' )
if [ -f ${VERSIONED_FILE_NAME} ]; then
if [ -f ${CHECKEDOUT_FILE_IN_THE_VIEW} ]; then
diff -b ${CHECKEDOUT_FILE_IN_THE_VIEW} ${VERSIONED_FILE_NAME} > /dev/null
if [ $? -ne 0 ]; then
##-- The checked-out file in the view is different from the corresponding
##-- versioned element in the VOB. So it has to be added to the backup list.
echo "${VERSIONED_FILE_NAME}" >> ${F_LOG}
fi
fi
fi
done
Any idea(s) ?. TIA.
Javier C.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
坦率地说,对于动态视图,更简单的备份策略是仅压缩和备份与所述动态视图关联的视图存储(在“cleartool endivew -server aDynViewTag”之后):
如果您需要通用解决方案 动态视图和快照视图,那么您可以参考:
'如何使用 ClearCasecleartool 查找所有签出文件?'(您正在使用的“
cleartool lsco
”),但您不需要计算最新版本来进行基于系统的差异。您可以简单地:
如果签出版本与其先前版本之间存在任何修改,它将返回一些内容(对于快照或动态视图中的版本)。
请参阅
cleartool diff
。Frankly, for dynamic views, a simpler backup strategy would be to just zip and backup the view storage associated with said dynamic view (after a '
cleartool endivew -server aDynViewTag
):If you need a generic solution both for dynamic and snaphot views, then you can refer to:
'How to find all checkedout files with ClearCase cleartool?' (a '
cleartool lsco
' you are using), but you don't need to compute the LATEST version to make a system-based diff.You can simply:
If any modification exists between the checked-out version and its previous version, it will return something (for versions in snapshot or dynamic views).
See
cleartool diff
.