Skip to content

Instantly share code, notes, and snippets.

@ichadhr
Created November 10, 2016 11:16
Show Gist options
  • Select an option

  • Save ichadhr/261e43116293748cb2bb515c0cd057e9 to your computer and use it in GitHub Desktop.

Select an option

Save ichadhr/261e43116293748cb2bb515c0cd057e9 to your computer and use it in GitHub Desktop.
Cleaning Log
#!/bin/bash
echo "Deleting log file"
sudo -s -- <<EOF
find /var/log -type f -regex ".*\.gz$" -delete
find /var/log -type f -regex ".*\.[0-9]$" -delete
echo "Done."
EOF
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment