Skip to content

Instantly share code, notes, and snippets.

@Arimeka
Created November 11, 2012 17:11
Show Gist options
  • Save Arimeka/4055547 to your computer and use it in GitHub Desktop.
Save Arimeka/4055547 to your computer and use it in GitHub Desktop.
Clean kern.log and syslog. I hope.
# 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