Showing results for 
Search instead for 
Do you mean 

Using Pax command

SOLVED
Go to Solution
Occasional Advisor

Using Pax command

[ Edited ]

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
Acclaimed Contributor Acclaimed Contributor

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.

Occasional Advisor

Re: Using pax command (to restore files)

Thanks will monkey around with it and let you know!