- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- tar extraction to current working directory. Is i...
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
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
тАО11-14-2002 06:49 AM
тАО11-14-2002 06:49 AM
Can I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 06:51 AM
тАО11-14-2002 06:51 AM
Re: tar extraction to current working directory. Is it possible
When you extract the archive, it will dump in your current location when you issue the command, so yes.
Hope this helps
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 06:54 AM
тАО11-14-2002 06:54 AM
Re: tar extraction to current working directory. Is it possible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 06:57 AM
тАО11-14-2002 06:57 AM
Re: tar extraction to current working directory. Is it possible
cd /directory_to_tar
tar cf output_tar_file files_or_dirs_to_tar
It's more difficult if you used absolute path names. You can use pax to extract this to a different directory.
Search the forums for "tar pax relative" and you'll find a number of threads. One is:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x38d6cf38d6bdd5118ff10090279cd0f9,00.html
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 06:59 AM
тАО11-14-2002 06:59 AM
Re: tar extraction to current working directory. Is it possible
Yes, you can do this using 'pax' ['tar's cousin]. For example, to extract into 'newdir' where the 'tar' was made with absolute paths to 'olddir', do:
# /sbin/pax -r -p e -s '%^/%/newdir/%' -f /dev/rmt/0m
...the above also preserves file timestamps and permissions. See the 'pax' man pages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 06:59 AM
тАО11-14-2002 06:59 AM
Re: tar extraction to current working directory. Is it possible
cd /directory_to_tar
tar cf output_tar_file files_or_dirs_to_tar
cd /directory_to_restore_into
tar xf tarfile_created_above
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 07:00 AM
тАО11-14-2002 07:00 AM
Solution# mkdir /tmp/myapps
# cd /tmp/myapps
# pax -r -s ',^/opt/appsA/,,' -f /tmp/test.tar -t
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 07:05 AM
тАО11-14-2002 07:05 AM
Re: tar extraction to current working directory. Is it possible
Instead you have to use pax...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2002 07:08 AM
тАО11-14-2002 07:08 AM
Re: tar extraction to current working directory. Is it possible
Example, tar files backed up as /a/b/c/d/*
On extracting system, you want to extract to /x/y/z and don't have a /a...
mkdir -p /a/b/c
cd /a/b/c
ln -s /x/y/z d
tar ...
You can then remove the temporary directories /a...
Regards,
John