Created
November 11, 2012 17:11
-
-
Save Arimeka/4055547 to your computer and use it in GitHub Desktop.
Clean kern.log and syslog. I hope.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clean .log files | |
# Go to /var/log | |
Dir.chdir("/var/log") | |
# Clean log files if size > 20 Mb | |
File.truncate("kern.log", 0) if File.size("kern.log") > (20 * 1024**2) | |
File.truncate("syslog", 0) if File.size("syslog") > (20 * 1024**2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment