I have a script providing login continuously( like 2-3 pages in a second). I was using below one liner.
sh myscript.sh > /home/user/mylog
I am running another script to zip this file when it reaches 100MB and create new file.
gzip /home/user/mylog;touch /home/user/mylog
But I think I am losing some logs in the time between
touch commands.Can somebody suggest a best practice NOT to lose any logs?