Linux: Limpeza de diretórios e zerando arquivos: Difference between revisions
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
find . | grep txt | xargs rm | find . | grep txt | xargs rm | ||
find . | grep native | xargs -n1 cp /dev/null | find . | grep native | xargs -n1 cp /dev/null | ||
find . | grep SystemOut_ | xargs rm | |||
find . | grep SystemErr_ | xargs rm | |||
find . | grep SystemOut.log | xargs -n1 cp /dev/null | find . | grep SystemOut.log | xargs -n1 cp /dev/null | ||
find . | grep SystemErr.log | xargs -n1 cp /dev/null | find . | grep SystemErr.log | xargs -n1 cp /dev/null | ||
Line 36: | Line 38: | ||
[[Category:Tecnologias]] | [[Category:Tecnologias]] | ||
[[Category:Fedora]] | [[Category:Fedora]] | ||
[[Category:find]] | |||
[[Category:grep]] | |||
[[Category:xargs]] |
Latest revision as of 17:16, 27 April 2017
Dica do amigo Rafael Vitalino
Esta pequena sequência de comandos faz a remoção de arquivos de logs e traces do IBM WebSphere Application Server, e pode ser usado em outros soluções bastando alterar o nome dos arquivos:
cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ find . | grep trace | xargs rm find . | grep txt | xargs rm find . | grep native | xargs -n1 cp /dev/null find . | grep SystemOut_ | xargs rm find . | grep SystemErr_ | xargs rm find . | grep SystemOut.log | xargs -n1 cp /dev/null find . | grep SystemErr.log | xargs -n1 cp /dev/null
Detalhando:
Altera para o diretório de logs do profile do WebSphere Application Server
cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/
Removendo arquivos trace.log, trace_.log, <ARQUIVOS>.txt
find . | grep trace | xargs rm find . | grep txt | xargs rm
Zerando arquivos native_stdout.log, native_stderr.log, SystemOut.log e SystemErr.log
find . | grep native | xargs -n1 cp /dev/null find . | grep SystemOut.log | xargs -n1 cp /dev/null find . | grep SystemErr.log | xargs -n1 cp /dev/null