Skip to content

Instantly share code, notes, and snippets.

@ArtiomL
Created January 26, 2014 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArtiomL/8640817 to your computer and use it in GitHub Desktop.
Save ArtiomL/8640817 to your computer and use it in GitHub Desktop.
cln - Space Cleaner
#!/bin/bash
# cln - Space Cleaner
# (CC0) No Rights Reserved
# Artiom Lichtenstein
# v1.0, 27/01/2014
apt-get clean
find /var/log/. -type f -iregex '.*\.\(gz\|[0-9]\|old\)$' -exec rm {} \;
find /var/log/. -maxdepth 1 -type f -exec sh -c '>{}' \;
find /var/log/apache2/. -type f -exec sh -c '>{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment