Log rotate recently rotated my logs a little to early so now webalizer is only displaying statistics for the last two days. After changing logrotat to run once a month instead of weekly I wanted to “repair” my apache log files. I always forget how to use the cat command so it became the perfect candidate for a quick article.
file1 – beginning text.
file2 – end text.
cat file1 file2 > newfile
You don’t have to create a new file. You can just append file1 to file2, but I chose this method just incase I messed something up. Here’s exactly what I did: cat access.log.1 access.log > test and once I verified the test file looked good I did a mv test access.log so now I have one giant log file. I then forced webalizer to run and everything looks good now. Since I’m on it, I actually had to copy access.log to access.log.1 to finally get webalizer to see everything I wanted. I forced webalizer to run by executing the /usr/bin/webalizer command on my debian system.
Related posts:
Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specifically the last part
I care for such info a lot. I was looking for this certain info for a very long time. Thank you and best of luck.