#!/bin/bash #set -x name=$1 tempfile=/tmp/fv_recs lstr2dir () { local lstr=$1 local lstrdate=$(echo $lstr | awk '{print $2}') local lstrtime=$(echo $lstr | awk '{print $3}' | awk -F@ '{print $1}') } #svdrpsend -p2001 LSTR | grep -i "$name" | sed "s/^[0-9-]* //g" > ${tempfile}_1.tmp svdrpsend LSTR | grep -i "$name" | sed "s/^[0-9-]* //g" > ${tempfile}_1.tmp ( cat <<'EOF' { split($1, date, "."); dday=date[1]; dmon=date[2]; dyear=date[3]; if(dyear>90) dyear=dyear+1900; dyear=dyear+2000; #split($3, tmp, ""); split($2, t, ":"); th=t[1]; tm=t[2]; printf("%d-%02d-%02d.%02d.%02d|", dyear, dmon, dday, th, tm); for(i=4; i /tmp/x.awk awk -f /tmp/x.awk ${tempfile}_1.tmp | sed "s/\//#2F/g" | sed "s/~/\//g" > ${tempfile}_3.tmp #cat ${tempfile}_1.tmp cat ${tempfile}_1.tmp | awk '{for(i=3; i ${tempfile}_2.tmp [ -f ${tempfile}_4.tmp ] && rm ${tempfile}_4.tmp for i in $(<${tempfile}_3.tmp) do x=$(echo $i | awk -F'|' '{printf("%s",$2);}' | sed "s/\r//g" | sed "s/:/#3A/g" | sed "s/\?/#3F/") f=$(echo $i | awk -F'|' '{printf("%s",$1);}') s=$(find /video/$x -name "$f*.rec" -exec du -sh {} \; | awk '{ printf("%s", $1); }') # | sed -sh {} \; | sed echo "$x ($s)" >> ${tempfile}_4.tmp #du -sh /video/$x | sed "s/\/video\///g" done if [ -f ${tempfile}_4.tmp ]; then cat ${tempfile}_4.tmp | sort else echo "'$name' nicht gefunden !" fi rm ${tempfile}_*.tmp