04-10-2013 10:20 AM - last edited on 04-10-2013 08:05 PM by Maiko-I
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
Solved! Go to Solution.
04-10-2013 07:40 PM
>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.