|
|
@@ -1,15 +1,15 @@
|
|
|
#!/bin/bash
|
|
|
#########################################################################
|
|
|
# Script for cleaning logs #
|
|
|
-# Created by DoIT #
|
|
|
+# Created by Pavol Macko - DoIT #
|
|
|
#########################################################################
|
|
|
|
|
|
#------------------------------ VERSION --------------------------------#
|
|
|
-VER="1.0"
|
|
|
+VER="1.1"
|
|
|
|
|
|
#------------------------------ HISTORY --------------------------------#
|
|
|
chhis(){
|
|
|
-echo -e "- \e[1;36mACTUAL script version [$VER]\e[0m\e[1;35m"
|
|
|
+echo -e "- \e[1;36mACTUAL script version [$VER]\e[0m"
|
|
|
echo -e "- \e[1;33mCleaning\e[0m [\e[1;35mhistory\e[0m]"
|
|
|
HIS=$(find /home/ -name .bash_history | egrep "pmacko|doit")
|
|
|
for h in $HIS; do rm -rf $h; done
|
|
|
@@ -56,7 +56,7 @@ journalctl --vacuum-size=100M > /dev/null 2>&1
|
|
|
#------------------------------ SPACE ----------------------------------#
|
|
|
chsiz(){
|
|
|
echo -e "- \e[1;32mActual size\e[0m of [\e[1;35mpartition\e[0m]"
|
|
|
-OVER=$(df -h | grep -v tmpfs | sed 's/ on//g' | grep "8[0-9]%" | awk '{print $1}' | head -1)
|
|
|
+OVER=$(df -h | grep -v tmpfs | sed 's/ on//g' | egrep "8[0-9]%|9[0-9]%|100%" | awk '{print $1}' | head -1)
|
|
|
if [ ! -z "$OVER" ];
|
|
|
then
|
|
|
df -h | grep -v tmpfs | sed 's/ on//g' | grep -v "$OVER"
|