Removing files from lost+found directory in clearcase UCM

给你一囗甜甜゛ 提交于 2021-02-08 08:01:53

问题


I want to delete all the files from lost+found directory in one go from command prompt.

How can i do that ?


回答1:


You can check the technote About the lost+found directory

Removing Objects from lost+found

Before taking any steps to clean out the VOB's lost+found, please make a backup of the VOB as a safeguard.

There are two possible ways to remove an object from the root of the lost+found:

  • The object can be moved to a new location in the VOB using the cleartool mv command
  • The object can be permanently deleted from the VOB.

In your case, you would do some cleartool rmelem -force lost+found/afile.

% pwd
/vobs/myvob/lost+found

% cleartool ls
test.c.f9e4e356252a11d0a41508000993b102@@/main/1    Rule: /main/LATEST

% cleartool rmelem test.c.f9e4e356252a11d0a41508000993b102 

As I mentioned in "How to remove a checkout without any view reference in clearcase?", you need to rmelem the files first, then the folder.

So write a script which does a cleartool find -type f myVob/loast+found first, then a find -type d.

You can combine a cleartool find with an -exec directive calling cleartool rmelem:

 ... -exec "cleartool rmelem -force \"%CLEARCASE_PN%\""

Be very careful with that rmelem command: once an element is remove from the vob, it cannot be recovered.



来源:https://stackoverflow.com/questions/31341606/removing-files-from-lostfound-directory-in-clearcase-ucm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!