Search code examples
clearcase

How to find old Clearcase views that no longuer uses?


Be careful I do not ask how to delete a view. I want to find the views that are no longer accessed by anyone.


Solution

  • You can use cleartool lsview, more precisely the -full option

    cleartool lsview -l -pro -full aViewTg
    

    With the -full option, reports the following additional properties:

    • When and by whom view-private data was last accessed
    • When and by whom a view-private object was last updated
    • When and by whom the config spec was last updated

    Note that won't catch all usecase of a view, as mentioned in "About the "Last Accessed" time stamp in cleartool lsview output"

    You can combine that with "Listing active views on UNIX"

    cleartool lsview -host your-computer-name
    

    And you can pipe the result to describe the properties of each view.

    You can see examples of such scripts in "Windows Equivalent of Unix Shell Script"

    for i in $list; do
        cleartool lsview -l -prop -full $i | grep "Last accessed" >& /dev/null
        if [ $? -eq 0 ]; then
             echo -n $i
             echo " " `cleartool lsview -reg ccase_win -l -prop -full $i | grep "Last accessed" | awk '{print $3}'`
        else
             echo $i cannot be found
        fi
    done