- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Extract file in different directory using tar
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
тАО12-30-2009 05:00 AM
тАО12-30-2009 05:00 AM
not able to extract file in different directory
e.g.
#cd /backup
#tar -cvf test.tar .
and then
#cd /test
#tar -xvf /backup/test.tar *
still its restoring files to /backup
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:17 AM
тАО12-30-2009 05:17 AM
Re: Extract file in different directory using tar
After taking backup, what is tar -tvf saying??
Regards,
Sooraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:20 AM
тАО12-30-2009 05:20 AM
Re: Extract file in different directory using tar
rw-r--r-- 0/3 7 Dec 30 15:36 2009 /backup/tap/ta
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:21 AM
тАО12-30-2009 05:21 AM
Re: Extract file in different directory using tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:37 AM
тАО12-30-2009 05:37 AM
Re: Extract file in different directory using tar
/backup/test
# ls
doc1
# tar -cvf /backup/test/bak.tar .
a ./doc1 1 blocks
a ./bak.tar 0 blocks
# ls
bak.tar doc1
# cd /db_dev
# ls
lost+found pairsfile.txt rac_db_oh
# tar -xvf /backup/test/bak.tar *
# ls
lost+found pairsfile.txt rac_db_oh
#
please see the output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:45 AM
тАО12-30-2009 05:45 AM
Re: Extract file in different directory using tar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 06:04 AM
тАО12-30-2009 06:04 AM
Re: Extract file in different directory using tar
what is the method to create compressed file on different folder
eg :
Source folder : /db_test
targer folder : /db_dev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 06:20 AM
тАО12-30-2009 06:20 AM
Re: Extract file in different directory using tar
If you have a 'tar' archive that was made with absolute paths, use 'pax' to extract it to a different directory:
# pax -r -s '|/db_test/|/db_dev/|' -f /backup/test.tar
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 07:06 AM
тАО12-30-2009 07:06 AM
Re: Extract file in different directory using tar
That's the most important thing here.
> what is the method to create compressed
> file on different folder
Specify a different destination path in the
"tar" command? You did it for extraction
(with the defective "*"):
> #tar -xvf /backup/test.tar *
So you should be able to do it for creation:
cd /db_test
tar cf /db_dev/db_test.tar .
or:
cd /
tar cf /db_dev/db_test.tar db_test
depending on what you want in the archive.
> [...] use 'pax' [...]
Or GNU "tar". A Forum search for keywords
like, say,
gnu tar pax
should find many old threads on this topic.
Note that:
> #tar -cvf test.tar .
would create an archive containing relative
paths, while:
> # tar -tvf tapbak
> rw-r--r-- 0/3 7 Dec 30 15:36 2009 /backup/tap/ta
shows an archive containing an absolute path.
It looks as if you're doing too many
different things at one time, and getting
more confused than necessary.