Last active
February 6, 2018 20:51
-
-
Save dedayoa/a60d0101a0c7eef1152d6e56592bd1c2 to your computer and use it in GitHub Desktop.
Bash script to help clean up all filled logs on ASTPP
This file contains 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
#!/bin/bash | |
# This bash script help release astpp from overfull logs To view the top 10 biggest directories cloggin up the HDD, run sudo du | |
# --block-size=M -a / | sort -n -r | head -n 10 empty astpp.logs | |
echo "Emptying astpp logs" | |
cd /var/log/astpp/ | |
> astpp.log | |
# empty freeswitch logs | |
echo "Emptying freeswitch logs" | |
cd /usr/local/freeswitch/log/ | |
sudo rm -f freeswitch.log.* | |
# empty fail2ban logs | |
echo "Emptying fail2ban logs" | |
cd /var/log/ | |
sudo rm -f fail2ban.log-* | |
> fail2ban.log | |
echo "Emptying fail2ban sqlite3 db" | |
sudo systemctl stop fail2ban | |
cd /var/lib/fail2ban/ | |
sudo rm -f fail2ban.sqlite3 | |
sudo systemctl start fail2ban | |
echo "Cleanup Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment