• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1000
  • Last Modified:

untaring files in a redhat sos report

I am hoping to untar individual files in an sos report

you get the idea

if you have not done it, it is not an easy question.  the format inside of an sos report is not pretty

redhat 5/6
2 Solutions
Seth SimmonsSr. Systems AdministratorCommented:
move the sos report file to an empty folder and extract
tar xJf <filename>
TIMFOX123Author Commented:
I was actually looking to save the space.  Most new servers are virtual and live on a small amount of san.   comparing many servers this way is not practical

tar xvf /path/to/file.tar -C /dir/to/extract/to /var/log/messages
Seth SimmonsSr. Systems AdministratorCommented:
file is compressed; need to use xJvf with tar

you would need to know the top level folder name that sosreport creates then from there you will find /var/log/messages; you can change the output directory where the report is created but not the file name

to find what name it uses, you can do tar tf <filename> | head -n 1 then take that top level folder and use that when extracting

you can also use that method to create a script if you have many you need to extract just a few files
tar -xvf sosreport.tar.xz --wildcards *var/log/messages
tar -xvf sosreport.tar.xz --wildcards *etc/ssh/ssdh.conf

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now