需求
查找日志目录下空间超额的任务:
> find log -name *err | xargs grep 'Disk quota exceeded'
log/SRR8117383_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117375_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117368_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117367_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117367_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117364_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117382_download.err:cat: write error: Disk quota exceeded
log/SRR8117382_download.err:cat: write error: Disk quota exceeded
log/SRR8117446_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117384_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117362_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117380_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117413_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117396_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117370_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117421_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117378_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117393_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117393_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117373_download.err:gzip: stdout: Disk quota exceeded
log/SRR8117433_download.err:gzip: stdout: Disk quota exceeded
- 删除错误的日志
find log -name *err | xargs grep 'Disk quota exceeded' | awk -F: '{print $1}' | uniq | xargs rm
- 得到错误的任务号
find log -name *err | xargs grep '117407' | cut -b 5-14 | uniq
网友评论