Hallo,
hatte folgendes Script lange Zeit auf einer SuSE-7.3 am laufen, unter OpenSuSE-11.2
klappt's nicht mehr.
Bash
#!/bin/bash
stats=/video/movies/temp/noadstat.txt
cat << EOM >/tmp/tmp.$$
#!/bin/bash
## start noad ....
echo "$@" | xargs /usr/local/src/noad/noad nice --background -B -S -O -j -a -o -c --asd --statisticfile=$stats after
## get pid ....
pid=\$(ps -x | grep "$1" | awk '{ print \$1 }' | head -1)
## message ....
/usr/local/src/VDR/svdrpsend.pl MESG "Werbung markieren gestartet, pid:(\$pid)"
## loooop ....
while [ 0 ]
do
sleep 1
## pid exist? ...
if ! (ps -p \$pid >/dev/null); then
## directory exist? ....
if test -d "$1"; then
## delete *.logo
find $1 -follow -type f -name 'cur.logo' -exec rm '{}' ';'
## marks exist? ....
if test -e "$1/marks.vdr"; then
## read lines ....
lines=\$(cat $1/marks.vdr | wc -w | sed -e 's/ //g')
fi
fi
## message / quit
/usr/local/src/VDR/svdrpsend.pl MESG "Werbung markieren beendet, pid:(\$pid), time:(\$time) \$lines"
break
fi
## get ~ time
time=\$(ps --no-headers -p \$pid -o "%x")
done
EOM
## get at / delete tmp file(s) ....
echo "cd /tmp;. tmp.$$; rm tmp.$$" | at now
Display More
Vielleicht kann sich das ja mal jemand anschauen.
Tschau