2015-10-16

[SOLVED]log-truncate

#14:58 29/07/2015
#################
#/opt/script/log-truncate1.sh
#Truncate all log from [$DIRS]
DIRS=/var/log
find $DIRS -type f -exec bash -c 'cat /dev/null > $0' {} \;




#/opt/script/log-truncate2.sh
#10:31 03/08/2015
for i in /var/log/nginx/*;       do cat /dev/null > $i; done
for i in /var/log/nginx_64180/*; do cat /dev/null > $i; done
for i in /var/log/nginx_64280/*; do cat /dev/null > $i; done
for i in /var/log/*;             do cat /dev/null > $i; done

for i in /var/log/audit/*;       do cat /dev/null > $i; done
for i in /var/log/glusterfs/*;       do cat /dev/null > $i; done
for i in /var/log/glusterfs/bricks/*;       do cat /dev/null > $i; done

No comments:

Post a Comment