ref del_logs.sh
This commit is contained in:
parent
f9accfe0f5
commit
53e57959c9
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user