本文介绍了在核心生成过程中压缩核心文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在生成核心转储期间是否可以压缩核心文件?

Is there way to compress the core files during core dump generation?

如果系统中的存储空间有限,那么在需要通过立即压缩生成核心转储的情况下,有什么方法可以保存它?

If the storage space is limited in the system, is there a way of conserving it in case of need for core dump generation with immediate compression?

理想情况下,该方法适用于2.6.x等较旧版本的linux.

Ideally the method would work on older versions of linux such as 2.6.x.

推荐答案

Linux内核/proc/sys/kernel/core_pattern文件将执行您想要的操作: http://www.mjmwired.net/kernel/Documentation/sysctl/kernel.txt#141

The Linux kernel /proc/sys/kernel/core_pattern file will do what you want: http://www.mjmwired.net/kernel/Documentation/sysctl/kernel.txt#141

将文件名设置为|/bin/gzip -1 > /var/crash/core-%t-%p-%u.gz之类的文件,并且应该为您压缩保存核心文件.

Set the filename to something like |/bin/gzip -1 > /var/crash/core-%t-%p-%u.gz and your core files should be saved compressed for you.

这篇关于在核心生成过程中压缩核心文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-17 00:29