20.2 Cleaning Up a View Manually

Users can remove derived objects from their views using standard tools (rm on UNIX, del on Windows, or the make clean targets in makefiles. You may also want to use a procedure like the one described here to analyze the files in a view's private storage area and select the ones that should be removed.

NOTE: This procedure applies only to dynamic views. For a snapshot view, you can use the cleartool ls -recurse -view_only command to inspect files in the view.

Suppose the view's view-tag is r2integ.

  1. Establish the view context. On UNIX, use the setview command:

  2. cleartool setview r2integ

    On Windows, use the net use command:

    net use * \\view\r2integ

    In Windows Explorer, use Tools > Map Network Drive.

  3. Take inventory of the view's private files with lsprivate. The Private Files subnode of the view storage node in the ClearCase Administration Console or the lsprivate command lists view-private files using the pathnames at which they appear in VOBs.

  4. cleartool lsprivate >C:\tmp\r2integ.lsp
    type C:\tmp\r2integ.lsp
    \proj\lib\pick.o
    \proj\lib\spar.o
    \proj\lib\get.c [checkedout]
    \proj\lib\get.c~
    \proj\lib\querytty.c [checkedout]
    \proj\lib\querytty.c~
    \proj\lib\strut.c [checkedout]
    .
    .
    .

    Be sure to place the output in a scratch inventory file, as in this example. Don't worry if some not available - deleted perhaps? error messages appear. Such messages are also captured in the scratch file.

  5. Extract the names of unneeded files. Use a text editor or any text filtering tool to extract from the scratch file the names of files that can safely be deleted. Write this list to another file-for example, c:\tmp\r2integ.deleteme. Exclude from the this list any checked-out files. Such files are annotated with [checkedout] in the lsprivate output, as shown in Step #2.

  6. Double-check the list. Make sure it contains only files to be deleted.

  7. Delete the view-private files.

  8. NOTE: The following steps are appropriate only if not available - deleted perhaps? error messages appeared in Step #2.

  9. Decide which stranded files to delete. The error messages, and corresponding lines with VOB- or DIR- in the inventory file, describe stranded view-private files. Such files belong to VOBs or directories that are not currently accessible-and, in some cases, may never become accessible again. Consult the lsprivate reference page to learn more about stranded files, and to decide which files to delete. In general, you don't select individual files, but entire directories or entire VOBs, all of whose view-privates files are to be deleted.

  10. Collect the appropriate UUIDs. Determine the UUID of each VOB directory and each VOB whose files are to be deleted. For example, the following lines from lsprivate output describes a stranded file named hello.c.ann:

  11. <VOB-beeb313c.0e8e11cd.ad8e.08:00:69:06:af:65>^
    <DIR-375b5ca0.0e9511cd.ae20.08:00:69:06:af:65>\hello.c.ann

    (The line is split here so that you can read it easily; it is not split in lsprivate's output.) The VOB from which the file is stranded has this UUID:

    beeb313c.0e8e11cd.ad8e.08:00:69:06:af:65

    The VOB directory in which the stranded file was created has this UUID:

    375b5ca0.0e9511cd.ae20.08:00:69:06:af:65.

  12. Move stranded files to the view's lost+found directory. To remove a set of stranded files, first transfer them to the view's lost+found directory, using the recoverview command. For example, this command transfers all stranded view-private files created in the same directory as hello.c.ann:

  13. cleartool recoverview -dir 375b5ca0.0e9511cd.ae20.08:00:69:06:af:65 -tag r2integ
    Moved file ccsvr03:\vus\integ\.s\lost+found\57FBB6DF.0418.util.c.ann
    Moved file ccsvr03:\vus\integ\.s\lost+found\2203B56D.00C2.hello.c.ann

    In this example, recoverview transfers two files, util.c.ann and hello.c.ann, to the lost+found directory.

  14. Delete the files from the lost+found directory. You can now use a standard file removal command to delete the stranded files:

  15. cd \vus\integ\.s\lost+found
    c:\vus\integ\.s\lost+found> del 57FBB6DF.0418.util.c.ann
    c:\vus\integ\.s\lost+found> del 2203B56D.00C2.hello.c.ann

You may want to adapt this procedure to your own organization's needs, and then present it to all ClearCase users.