Score:0

Saving contents of /proc/net

us flag

I'm trying to archive files from /proc/net when a process crashes. This is to aid in debugging, to get understanding about the machine status when crash happened.

The contents are not regular files, but interface to internal data structures in the kernel.

# file /proc/net/arp
/proc/net/arp: empty

# cat /proc/net/arp  | head -n 3
IP address       HW type     Flags       HW address            Mask     Device
172.18.0.2       0x1         0x2         02:42:ac:12:00:02     *        docker0
172.18.0.3       0x1         0x2         02:00:00:00:00:13     *        docker0

Though cat command displays the content, I'm not able to archive it with tar. Example to demonstrate with a single file:

# tar -cvf net.tar /proc/net/arp
tar: Removing leading `/' from member names
/proc/net/arp

# tar -xvf net.tar
proc/net/arp

# cat proc/net/arp
#

What would be the best way to archive /proc? Is having a script to iterate all files and cat the contents the only possibility?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.