- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar to different directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 12:45 PM
тАО08-03-2000 12:45 PM
tar to different directory
for example:
tar tvf /dev/rmt/c0t0d0BEST, shows file on tape as /tmp/file1.
then:
tar xvf /dev/rmt/c0t0d0BEST /disk1/file1 would not copy file1 to /disk1 directory.
But I can tar xvf back to /tmp where the file1 being tar cvf from.
Can somebody helps?
- Tags:
- tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 12:53 PM
тАО08-03-2000 12:53 PM
Re: tar to different directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 12:54 PM
тАО08-03-2000 12:54 PM
Re: tar to different directory
All is not lost, though. I believe the pax command will be able to do a string replacement on the extraction path for you. Please see man pax for the syntax and details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 01:03 PM
тАО08-03-2000 01:03 PM
Re: tar to different directory
but how about to get just some files instead of all of them from the tape?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 01:06 PM
тАО08-03-2000 01:06 PM
Re: tar to different directory
The documentation said that using
tar xvf archive file_name you can extract desired file... Ty it....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 01:32 PM
тАО08-03-2000 01:32 PM
Re: tar to different directory
tar vxf /dev/rmt/0m file/to_be.restored
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2000 02:09 PM
тАО08-03-2000 02:09 PM
Re: tar to different directory
pax -r -v -s !/olddir!/newdir!gp -f Tape_Device_File
See man page of pax for more details.
- Tags:
- pax
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2000 05:31 AM
тАО08-04-2000 05:31 AM
Re: tar to different directory
Example:
files location to be tar: /disk3/file1,file2...
I has done:
tar cvf /dev/rmt/c2t0d0BEST /disk3/file1,file2...
In order to get files back to any other location, what should I use to tar at the begining?
tar cvf /dev/rmt/c2t0d0BEST disk3 ? or any?
Thanks a lot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2000 06:58 AM
тАО08-04-2000 06:58 AM
Re: tar to different directory
Absolute backup(i.e. /test/files , you can restore from anywhere and it will restore in the correct directory , with relative backup you can specify where you want to restore files i.e (.file1 / ./test/file)
if you want to backup all the files in a directory ( relatively) :-
1. cd into the directory
tar cvbf 64 /dev/rmt/0m .
*when you look at the files on tape they will be .file1 .file2 .file3 etc..
However if you want to do a relative backup from root
cd /
tar cvbf 64 /dev/rmt/0m "./dir1/dir2"
on the tape files will be listed as
./dir1/dir2/file1 , ./dir1/dir2/file2 etcc
so to restore to say test1 dir , it will create direcries dir1,dir2 under test
where as the first method will restore files
in the directory you CD'ed into.
Basically a dot (.) means relative i.e. current directory
and / means absolute
To restore individual files or directories
put them in quotes i.e.
tar xvbf 64 /dev/rmt/0mn "./file2" "/tmp/ds"
one other thing is create a directory if you do not have spare tapes and create some dummy files and try out the tar command
so instead of using the tape device use a file name for the tar archive and view this later i.e. tar cvbf 64 testtar "files"
to view tar tvf testtar
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-06-2000 08:28 PM
тАО08-06-2000 08:28 PM
Re: tar to different directory
Normally I would do the following:
cd
tar -cvf /dev/rmt/0m .
Note that there is a . (dot) at the the end, to indicate the current directory.
this way all the files and subsequent directories are on the tape, to reload them
in a desired directory,
cd
tar -xvf /dev/rmt/0m
The files in the tar are listed with a . (dot) at beginning, to indicate a relative pathname from the current directory.
Regards, Andre