Curatare log-uri
Cod:
find /usr/game -name “*.core” -print -exec rm {} \;
find /usr/game -name “p2p_packet_info.txt” -print -exec rm {} \;
find /usr/game -name “packet_info.txt” -print -exec rm {} \;
find /usr/game -name “stdout” -print -exec rm {} \;
find /usr/game -name “syserr” -print -exec rm {} \;
find /usr/game -name “syslog” -print -exec rm {} \;
find /usr/game -name “udp_packet_info.txt” -print -exec rm {} \;
find /usr/game -name “VERSION.txt” -print -exec rm {} \;
##questa parte deleta i file non necessari dentro le cartelline di game
#/log
rm -fr /usr/game/all_log/auth/log/*
rm -fr /usr/game/all_log/db/log/*
rm -fr /usr/game/all_log/first/log/*
rm -fr /usr/game/all_log/game1_1/log/*
rm -fr /usr/game/all_log/game1_2/log/*
rm -fr /usr/game/all_log/game1_3/log/*
rm -fr /usr/game/all_log/game2/log/*
rm -fr /usr/game/all_log/game61/log/*
rm -fr /usr/game/all_log/game99/log/*
##questa parte deleta i log vecchi
#db log
id=”user”
pwd=”password”
mysqldump -u $id -p$pwd –add-drop-table –no-data log | mysql -u $id -p$pwd log
##questa parte cancella e ricrea tutte le tabelle del db log
echo “Boom!”
#fine
1. Salvati fisierul in root/ cu numele clean.sh
2. Da-i unele permisiuni prin tastarea chmod 755 clean.sh
3. Incepeti cu tastarea ./clean.sh