Quick Review: Boxee Box
December 27, 2011 – 12:22 am | 3 Comments

Some of the technical issues with Boxee Box could have been fixed if the dev team was paying more attention to addressing the bugs rather than adding “features” of dubious value. In the final analysis, for the price and ease of use, Boxee Box is the best in its class and price range. You just need to be mindful of its limitations and buy it in hope of future improvements to its usability.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

Compress Old Log Files on Linux

Submitted by on January 12, 2012 – 6:06 pmNo Comment
Compress Old Log Files on Linux

Most log files located in /var/log are part of the log rotation and will be compressed automatically. However, in many cases various user applications maintain log files outside of /var/log. These logs are not managed by the system and can consume a lot of disk space if not cleaned up on a regular basis. The simple script below will find all old log files in /opt that are larger than 10Mb and have the name of “something.log.something”. This syntax is most commonly used for old log files created by applications during the log rotation process. For example: /opt/application/logs/application.log.0

find /opt -type f -mtime -200 -size +10240k -exec ls -als {} \; | sort -rn | grep "log\." | grep -v "\.gz" | awk '{print $NF}' | while read line
do
echo "Compressing $line"
gzip "${line}"
done

Popularity: 1% [?]

Related posts:

  1. Using rsync to copy files
  2. Copy directory structure and files with cpio
  3. Executing commands with ‘find’
  4. Monitoring Veritas VM problems on Solaris
  5. Find largest files
  6. Unix Files Transferred To CD
  7. Sharing Videos from Linux to Xbox 360
  8. Testing RAM in Linux

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.