- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to put more than one tar file on a tape
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
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
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
тАО05-01-2009 09:13 AM
тАО05-01-2009 09:13 AM
How to put more than one tar file on a tape
I have two directories that I would like to back up to tape using tar. I need to keep them as separate files.
What would be the correct command syntax to use in order to have two separate tar files on a single tape? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 09:28 AM
тАО05-01-2009 09:28 AM
Re: How to put more than one tar file on a tape
Otherwise you can do the following
cd 1stdirectory
tar cvf /dev/rmt/Xn .
cd 2nddirectory
tar cvf /dev/rmt/X .
Where X is your tape drive device number. Note the use of the "n" in the "rmtXn" in the first tar command. This is very important to use and is for the "no rewind" tape device and leaves the tape at the end of the first tar file.
I try to avoid using this method because if you ever need to un-tar the second tar file from the tape you must remember that the tape contains two different tar files and skip forward the first tar file to be able to get to the second file and start un-tar-ing.
mt -f /dev/rmt/Xn fsf 1 (forward skip 1 file)
tar xvf /dev/rmt/X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 09:29 AM
тАО05-01-2009 09:29 AM
Re: How to put more than one tar file on a tape
Given that they are separate directories I don't see the need to keep them as separate archives.
You could even 'tar' them using absolute paths and then stipe those paths during a restoration using 'pax' to restore into a different directory should that be necessary. For example:
# tar -cvf /dev/rmt/0m /etc/rc.config.d /sbin/init.d
# mkdir /tmp/etc
# cd /tmp/etc && pax -r -s '|/etc/*|./|' -f /dev/rmt/0m
...to "un-tar" the '/etc/rc.config.d' into '/tmp/etc/rc.config.d'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 09:55 AM
тАО05-01-2009 09:55 AM
Re: How to put more than one tar file on a tape
Right.
>You could even 'tar' them using absolute paths
You can also use tar's -C to store them both as relative:
tar -cf tape-device -C /path1 . -C /path2 .
>pax -r -s '|/etc/*|./|' -f /dev/rmt/0m
>to "un-tar" /etc/rc.config.d into /tmp/etc/rc.config.d.
Won't this also read /sbin/init.d back on itself? I.e. you need to add /etc/rc.config.d to the end of pax to select which to restore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 10:10 AM
тАО05-01-2009 10:10 AM
Re: How to put more than one tar file on a tape
> Dennis: Won't this also read /sbin/init.d back on itself? I.e. you need to add /etc/rc.config.d to the end of pax to select which to restore.
Ah, yes, good catch! Thanks.
# cd /tmp/etc && pax -v -r -s '|/etc/*|./|' -f /dev/rmt/0m /etc/rc.config.d
...would extract only '/etc/rc.config.d' into '/tmp/etc'. That is, strip the absolute path and substitute a different directory as the destination.
Notice too, that I added the verbose ('-v') option to trace *exactly* what was restored. This would have immediately uncovered the unintentional recovery action caught by Dennis :-).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 10:17 AM
тАО05-01-2009 10:17 AM
Re: How to put more than one tar file on a tape
I think if you leave off -r, you can see what will be restored and see what the -s will do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-01-2009 11:38 AM
тАО05-01-2009 11:38 AM
Re: How to put more than one tar file on a tape
It ignores the -s when doing a list.