Quick tip on zipping logs in real time.
Sometimes, some small things that we don’t actually think can be useful are such useful. I faced this couple of days back when I was working on something and the amount of logs getting generated and the files getting rotated was too fast. If I had to use this for sometime, I needed some script, application or something to make sure that the logs are zipped every few seconds. Finding an application for this would take time and what good is bash if we need to find applications for this. So, a simple bash command did the trick. Most of us would know this but applying it and using it at the right time, was what saved my life. Thanks to bash. Here is the command:
1
2 3 4 5 6 7 8 9 |
Can it get simpler than this 🙂
Related Articles:
- 2010/06/25 Delete Files older than 14 days
- 2010/06/25 bash one liner to change/remove test pattern from config file or text file.
- 2010/06/24 Script to add all the partitions to the fstab.
- 2010/05/19 bash script to change icon theme to check out all the installed themes (personal)
- 2010/05/07 bash script to periodically change the cursor theme.
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.