hi Radoulov,
Thank you for your kindly reply^^
i would like to add the function to archive the log daily, can i do it like this?
but is not working, is it the "IF" statement is out of the "WHILE" loop ?
======================================================================
previousDay=`date --date "1 days ago" "+%Y%m%d"`
nowTime=`date "+%H%M%S"`
nohup tail -f access.log|while IFS= read -r;do
case $REPLY in
(*abcdef*)printf "%s\n" "$REPLY">>abcdef.txt;;
(*123456*)printf "%s\n" "$REPLY">>123456.txt;;
esac
if [ $nowTime == 000000 ]; then
mv abcdef.txt abcdef.txt."$previousDay"
mv 123456.txt 123456.txt."$previousDay"
fi
done &
=======================================================================