- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- assistance with 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
Forums
Discussions
Discussions
Discussions
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
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-28-2001 11:08 AM
11-28-2001 11:08 AM
I have a file that I would like to tar using relative path onto a tape. How would I do that. Any help will be greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 11:19 AM
11-28-2001 11:19 AM
Re: assistance with tar
tar cvf filename.tar ./opt
Then when you are done enter
tar tvf filename.tar
and verify that the files have a leading ., this will let you know for sure that they will extract relative to your current dir.
Good Luck,
C
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 02:43 PM
11-28-2001 02:43 PM
Re: assistance with tar
cd to / and put a . in front of the full path like: ./etc/fstab
tar cvf /dev/rmt/0m ./etc/fstab
or cd to the directory and tar up the file from there
cd /etc
tar cvf /dev/rmt/0m fstab
or tar the files up with the full path and use the pax utility to change the path when you untar them. pax is cool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 03:44 PM
11-28-2001 03:44 PM
Re: assistance with tar
ex: you want to tar files under
/test/test1/test2
cd to /test/test1 then
execute:
#tar cvf test2
d_b
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 03:45 PM
11-28-2001 03:45 PM
Re: assistance with tar
it should be
#tar cvf /dev/rmt/0m test2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2001 04:20 PM
11-28-2001 04:20 PM
Re: assistance with tar
Just remember that a relative path starts from your current directory. The relative path you specify when creating the tar file is how it will be extracted - BUT it will be relative to your current directory when you actually do the extract.
Example:
cd /home/sanman
tar cvf /dev/rmt/0m subdir1/subdir2/file1
By the way, you can choose to start the path with a "./" if you wish but that isn't neccessary.
So in the above example you have created a tarfile that contains one file. When you extract that file using tar it will be written to the same relative path but it will be relative to your current directory then.
So...
cd /var/tmp
tar xvf /dev/rmt/0m
will extract the file to /var/tmp/subdir1/subdir2/file1
If /var/tmp/subdir1/subdir2 does not exist, it will be created.
You could tar and extract the same file like this:
cd /home/sanman/subdir1/subdir2
tar cvf /dev/rmt/0m file1
cd /var/tmp
tar xvf /dev/rmt/0m
The difference with the second example is that the file will be extracted to /var/tmp/file1
Lastly, if you don't know if a tarfile was created using relative or absloute pathnames, use the "tv" options to see the contents of the tarfile.
Darrell