Hi all,
Having a regular size-efficient backup for only the modified checkedout elements in all views would be a great thing for us, since a great deal of the defined dynamic/snapshot views cannot be included in the daily backup policy.
The following ksh code is near to what we would need for a dynamic view, but it trivially assumes that the first line in the config-spec file for the view always selects the checked-out element first ( *element * CHECKEDOUT* ). It will not work well in general.
For each versioned file in the view we would like to be able to add it to the backup list only if it is different from the last corresponding versioned element in the VOB that is selected for that view. (Only if it has been developed in the view).
[The solution would have to be valid for snapshot views also]
for CHECKEDOUT_FILE_IN_THE_VIEW in $( /usr/atria/bin/cleartool lsco -cview -avobs -short )
do
VERSIONED_FILE_NAME=$( /usr/atria/bin/cleartool describe -short ${CHECKEDOUT_FILE_IN_THE_VIEW} \
| sed -e's/CHECKEDOUT/LATEST/' )
if [ -f ${VERSIONED_FILE_NAME} ]; then
if [ -f ${CHECKEDOUT_FILE_IN_THE_VIEW} ]; then
diff -b ${CHECKEDOUT_FILE_IN_THE_VIEW} ${VERSIONED_FILE_NAME} > /dev/null
if [ $? -ne 0 ]; then
##-- The checked-out file in the view is different from the corresponding
##-- versioned element in the VOB. So it has to be added to the backup list.
echo "${VERSIONED_FILE_NAME}" >> ${F_LOG}
fi
fi
fi
done
Any idea(s) ?. TIA. Javier C.