I have a script where I'm fetching the logs from the tomcat and sending that into the my cloud resource. Everything works well, but I have a problem when my tomcat rotates the log.
When the logs get rotated its been prefixed with date ( log gets rotated every day ). Since my script just runs every half an hour I may miss the logs when it gets rotated, because I'm fetching the logs with their static name, in the example logfile.log
.
Before getting rotated the file will look like this :
logfile.log
After getting rotated, it will look like this :
logfile.log.2012-10-09
Are there any ways to get rid of this problem?
Edit:
My script :
cp /tomcat/logs/$logname $fileName
gzip $fileName
s3cmd put $fileName.gz s3://x.x.x.x.x/$folderName
Thanks in advance.