clearcase:在所有视图中仅备份修改后的检出元素 [英] clearcase: Backup for only modified checked-out elements in all views

查看:110
本文介绍了clearcase:在所有视图中仅备份修改后的检出元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于所有视图中仅 个修改后的检出元素,要定期进行尺寸高效的备份,这对我们来说是一件好事,因为很多已定义的动态/快照视图无法包含在每日备份策略。

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.

以下ksh代码接近我们动态视图所需的代码,但它简单地假设config-spec文件中的第一行用于视图总是先选择签出的元素(* element * CHECKEDOUT *)。

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.

对于视图中的每个版本文件,我们希望能够将其添加到备份列表中,仅 >如果它与为该视图选择的VOB中最后一个对应的版本化元素不同。 (仅在视图中已开发)。

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

任何想法?。 TIA。
Javier C。

Any idea(s) ?. TIA. Javier C.

推荐答案

坦率地说,对于动态视图,一种更简单的备份策略是压缩并备份与所述动态视图关联的视图存储(在' cleartool endivew -server aDynViewTag 之后):

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):


  • 所有已签出和私有文件都存储在视图存储中(仅用于动态视图)

  • 但它不会考虑到(但)已签出文件

如果您需要同时使用动态视图和快照视图,那么您可以参考:

'如何查找所有使用ClearCase cleartool的签出文件?(一个' cleartool ls co '),但是您无需计算最新版本即可创建基于系统的差异。

您可以简单地:

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:

cleartool diff -pred ${CHECKEDOUT_FILE_IN_THE_VIEW}

如果签出的版本与其先前版本之间存在任何修改,它将返回一些内容(对于快照或动态视图中的版本)。

请参见 cleartool diff

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.

这篇关于clearcase:在所有视图中仅备份修改后的检出元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆