The following will record audio from the input on the sound card and save it in ogg vorbis format in increments of 1 hour /w a time stamp as the file name.
while [ 0 ]
do
filename=`date +”20%y%m%d-%H%M”`
#record 1 hour of audio
arecord -d 3600 -vv -c 1 -f S16_LE -r24000 “$filename.wav”
#convert to ogg vorbis
oggenc -q5 “$filename.wav” &
#remove wav file
(sleep 5;rm “$filename.wav”)&
done