1

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

How can i do that ?

sakshi
  • 283
  • 3
  • 15

1 Answers1

0

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250