Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-04-02T06:10:57Z by Dave-Robinson
SystemAdmin
SystemAdmin
47293 Posts
ACCEPTED ANSWER

Pinned topic Removing Elements using rmelem command in cleartool

‏2013-03-08T14:06:30Z |
Hi

I am trying to remove all the elements under root directory and under sub-directories using rmelem command. It is removing elements from root directory and sub-directories but moving elements from sub-directories to lost+found folder. Anybody has any idea about this ?

How can i remove all the elements from root directory and sub-directories all together ??

Element "S:\naagh_dummy_dsp_naagh_2_int\DUMMY_NAAGH\NAAGH_DB\naagh1" has 2 branc
hes, 3 versions, and is entered
in 2 directory versions.
Destroy element? no n
cleartool> rmelem -c S:\naagh_dummy_dsp_naagh_2_int\DUMMY_NAAGH\NAAGH_DB\*
CAUTION! This will destroy the element, all its branches and versions,
including all data, meta-data and history, and will remove the element
from all directory versions that now contain it. Once you destroy the
element, there will be no way to restore it to its current state.
If you want to preserve the element, but remove references to it from
future directory versions, use the "rmname" command.

This is how, I am doing it.

cleartool> rmelem -c -rm S:\naagh_dummy_dsp_naagh_2_int\DUMMY_NAAGH\NAAGH_DB\*

Element "S:\naagh_dummy_dsp_naagh_2_int\DUMMY_NAAGH\NAAGH_DB\naagh1" has 2 branc
hes, 3 versions, and is entered
in 3 directory versions.
Destroy element? no y
cleartool: Warning: Object "x.xml" no longer referenced.
cleartool: Warning: Moving object to vob lost+found directory as "x.xml.50cac84f58184ac0991fc4d4186a29b3".
Updated on 2013-04-02T06:10:57Z at 2013-04-02T06:10:57Z by Dave-Robinson
  • SystemAdmin
    SystemAdmin
    47293 Posts
    ACCEPTED ANSWER

    Re: Removing Elements using rmelem command in cleartool

    ‏2013-03-08T14:40:18Z  in response to SystemAdmin
    Every object in the file system has a reference counter, which refers to the number of places the element is referred to. In this case you've destroyed the parent directory and reduced the reference count to zero. As the element is no longer referred to anywhere in the file system, MVFS moves the object to lost+found. If you don't want this to happen you'll need to work from the bottom up removing the contents before destroying the directory element.

    If you wish to remove the complete contents of the VOB it is probably quicker and easier to delete the VOB and recreate it.

    Regards
    Phil
    • SystemAdmin
      SystemAdmin
      47293 Posts
      ACCEPTED ANSWER

      Re: Removing Elements using rmelem command in cleartool

      ‏2013-03-08T16:06:37Z  in response to SystemAdmin
      I have a big directory structure so I can not go Bottom to Top..
      • Dave-Robinson
        Dave-Robinson
        116 Posts
        ACCEPTED ANSWER

        Re: Removing Elements using rmelem command in cleartool

        ‏2013-04-02T06:10:57Z  in response to SystemAdmin
        What Phil means by going from bottom to top is to use the "-depth" parameter of "cleartool find"

        cleartool find base-directory -depth -exec "cleartool rmelem -f %CLEARCASE_PN%"