ref del_logs.sh

This commit is contained in:
TheK4n 2021-10-02 01:30:20 +03:00
parent f9accfe0f5
commit 53e57959c9

View File

@ -2,7 +2,7 @@
# removes log files with size greater then 100Mb
for i in $(sudo du -a /var/log/* | sort -hr | tr '\t' ':')
for i in $(du -a /var/log/* | sort -hr | tr '\t' ':')
do
size_file=( $(echo "$i" | tr ':' ' ') )
@ -11,7 +11,7 @@ do
file="${size_file[1]}"
if [ "$size" -ge 102400 ] && [ -f "$file" ]; then
sudo rm "$file"
rm "$file"
fi
done