Well, it works. Thansk for all the tips. The problem is the batch option. For some reason -b doesn't work for me but -B and --batch do. So, there is no need for "nice" or changing priorities for at. The environment for at is also okay. (well, in my case). Just to make things clear I have attached my test script. It records 2 different sessions, this was just for testing purposes. Oh, the -B/--batch option also solved the problem of lavrec not quitting after the specified time with -t.
I don't know what's wrong with the B and b. Is this just a typo in the source? Thanks again for the tips. Dirk
#!/bin/bash # usage: script_capture station, recording time, filename, station, filename v4lctl -v 0 setstation $1 date>at_log lavrec -B -i a -f a -s -g 384x288 --software-encoding -q 80 --file-flush 50 -b 512 -n 256 -a 16 -l 90 -R l -t $2 $3\%02d.avi echo "1 done">at_log date>>at_log v4lctl -v 0 setstation $4 lavrec --batch -i a -f a -s -g 384x288 --software-encoding -q 80 --file-flush 50 -b 512 -n 256 -a 16 -l 90 -R l -t $2 $5\%02d.avi echo "3 done">>at_log date>>at_log