La adopción de las soluciones anteriores, el siguiente podría ser útil
#------------------------- Show Repositories, Revisions and Individual Sizes -------------------- SuN --- 2011-11-14 -- {
CSVN_DIR=/opt/csvn
cd ${CSVN_DIR}
REPO_PREFIX="${CSVN_DIR}/data/repositories"
REPO_SUFFIX="db/current"
for i in `ls ${REPO_PREFIX}/*/${REPO_SUFFIX} `
do
if [ -f $i ]
then
FILENAME=`ls -l $i`
REV_NO=`cat $i`
REPONAME=`echo $i | awk '{ srch="'${REPO_PREFIX}'/"; idx = index($0,srch); xstr=substr($0,idx + length(srch)); idx = index(xstr, "/'${REPO_SUFFIX}'"); print substr(xstr,1,idx-1)}'`
#REPONAME=sn_library
${CSVN_DIR}/bin/svn list --verbose --recursive https://vctl.ds.xxxxxx.in:9501/svn/${REPONAME} | awk 'BEGIN {repo="'${REPONAME}'"; rev="'${REV_NO}'";} {print "Repository: " repo " Revision: " rev $0 } '
fi
done
#------------------------- Show Repositories, Revisions and Individual Sizes -------------------- SuN --- 2011-11-14 -- }
o
#------------------------- Show Versions of Repositories and Total Size -------------------- SuN --- 2011-11-14 -- {
CSVN_DIR=/opt/csvn
cd ${CSVN_DIR}
REPO_PREFIX="${CSVN_DIR}/data/repositories"
REPO_SUFFIX="db/current"
for i in `ls ${REPO_PREFIX}/*/${REPO_SUFFIX} `
do
if [ -f $i ]
then
FILENAME=`ls -l $i`
REV_NO=`awk '{print $1; exit}' $i`
REPONAME=`echo $i | awk '{ srch="'${REPO_PREFIX}'/"; idx = index($0,srch); xstr=substr($0,idx + length(srch)); idx = index(xstr, "/'${REPO_SUFFIX}'"); print substr(xstr,1,idx-1)}'`
#REPONAME=sn_library
COL_PREFIX="Repository:\t${REPONAME}\tRevision No:\t${REV_NO}\t${FILENAME}"
COL_PREFIX=`echo "${COL_PREFIX}" | awk '{xstr = $0; gsub(" ","_",xstr); gsub(":","_",xstr); print xstr;}'`
${CSVN_DIR}/bin/svn list -vR https://vctl.ds.xxxxxx.in:9501/svn/${REPONAME} | awk 'BEGIN{xstr="'${COL_PREFIX}'"} {if ($3 !="") sum+=$3; i++} END {print xstr "\tTotal size= \t" sum/1024/1024 "\tMB" "\t spread across \t" i "\tfiles/folders "}'
fi
done
#------------------------- Show Versions of Repositories and Total Size -------------------- SuN --- 2011-11-14 -- }
Parece que funciona bien, pero toma un tiempo horrible y ni idea de cuánto tráfico se traga ya. En PowerShell es tan fácil como: '([xml] (svn list --xml --recursive https: // svn/repo/path)) .lists.list.entry | medida -sum size' – Joey
¿Funciona con externos también? – cetnar
No. Los externos son un juego completamente diferente. –