Compressing the core files during core generation

前端 未结 3 1727
野性不改
野性不改 2021-02-07 22:01

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 c

3条回答
  •  [愿得一人]
    2021-02-07 22:42

    For an embedded Linux systems, following script change perfectly works to generate compressed core files in 2 steps

    step 1: create a script

    touch /bin/gen_compress_core.sh
    chmod +x /bin/gen_compress_core.sh

    cat > /bin/gen_compress_core.sh #!/bin/sh exec /bin/gzip -f - >"/var/core/core-$1.$2.gz"
    ctrl +d

    step 2: update the core pattern file

    cat > /proc/sys/kernel/core_pattern |/nuova/bin/gen_compress_core.sh %e %p ctrl+d

提交回复
热议问题