Simpler Navigation coming for Servers and Operating Systems
Coming soon: a much simpler Servers and Operating Systems section of the Community. We will combine many of the older boards, and you won't have to click through so many levels to get at the information you need. If you are looking for an older board and do not find it, check the consolidated boards, as the posts are still there.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Pax command

SOLVED
Go to solution
Highlighted
dx12180
Occasional Advisor

Using Pax command

I want to learn how to extract just a single file from my tapes using the pax command. As of right now I have been using these command to write, list, and recover my data but am not sure how to just recover one file or directory from the back up tape. Does any one have any solution.

 

 

 

- Back up your files system

 

pax -vwf /dev/rmt/0m /home

 

- List the items on the disk

 

pax -f /dev/rmt/0m -v

 

- Extract your files from the disk

 

pax -r -pe -f /dev/rmt/0m

 

 


P.S. This thread has been moved  from Your Questions Regarding ITRC Forums (Legacy ITRC forum) to HP-UX > sysadmin - HP Forums Moderator

2 REPLIES
Dennis Handly
Acclaimed Contributor
Solution

Re: Using pax command (to restore files)

>not sure how to just recover one file or directory from the back up tape.

>pax -v -f /dev/rmt/0m # List the items on the tape

 

You look at the output of the listing above and use that name.  If you want /home/foo/bar.out and directory /home/foo/SUB1:

pax -r -v -pe -f /dev/rmt/0m /home/foo/bar.out /home/foo/SUB1

 

Since you used an absolute path to store the files, you will get the files back in the same path unless you use the -s option:

pax -r -v -k -pe -f /dev/rmt/0m -s:/home/foo/:: /home/foo/bar.out /home/foo/SUB1

 

Use -k to make sure you have your -s patterns correct.  Also use a small archive to disk to make sure you are familiar with the options.

dx12180
Occasional Advisor

Re: Using pax command (to restore files)

Thanks will monkey around with it and let you know!