- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Tar command
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
12-05-2002 03:45 AM
12-05-2002 03:45 AM
Tar command
For example, tar cvf /dev/rmt/0m /etc/hosts. Want use "tar 'option' /dev/rmt/0m 'current directory'"
Ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 03:53 AM
12-05-2002 03:53 AM
Re: Tar command
see 2.3 if your restore whole archive
2.0 tar
2.1 Save a Directory Path With `tar'
If the f option with `tar' is omitted it will take /dev/rmt/0m as the
default tape device file. If your tape drive device file differs, add the
`f' option.
tar cv /directory (absolute path not recommended)
cd /directory; tar cv . (relative path recommended)
or
tar cv ./dir1 ./dir2 ./dir3 ..... (for multiple directories)
2.2 What is written on the `tar' tape?
tar tv
tar tv >/tmp/index
2.3 Restore with `tar'.
cd /directory ; tar xv (relative tar restore)
2.4 `tar' via network.
Write a `tar' tape on a remote computer that owns a DAT/DDS drive.
cd /relative_path
tar cvf - . | remsh name -l user "cat - | dd of=/dev/rmt/0m bs=10k"
Restore a `tar' tape from a remote computer that owns a DAT/DDS drive.
cd /relative_path
remsh name -l user dd if=/dev/rmt/0m bs=10k | tar xvf -
2.5 Good to know about tar!
`tar' is an easy command and can be used as interchange format. These are
the only advantages.
I would like to advise you not to use `tar' to back-up a couple of gigabytes,
because `tar' does not support `regular expressions'. Selected file
retrieval is only possible by this command:
tar xv `tar t | grep "^user/drawings*"
To backup and recover to another directory with great options you need fbackup/frecover.
Regards
Steve Steel
Quote of the moment
-------------------
"We are drowning in information but starved for knowledge."
-- John Naisbitt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 03:54 AM
12-05-2002 03:54 AM
Re: Tar command
The best you can hope for is to create the archive using
cd /etc
tar cvf /dev/rmt/0m hosts
This will then create the archive with no leading directories, so that you can then use
cd /your_new_dir
tar xvf /dev/rmt/0m hosts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 04:06 AM
12-05-2002 04:06 AM
Re: Tar command
http://hpux.cs.utah.edu/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 04:09 AM
12-05-2002 04:09 AM
Re: Tar command
tar -cvf /dev/rmt/rmt/0m ./etc/*
But in case you do take it absolute path names you can restore wiht pax.
cd /your_dir
pax -rv -s '/^\///' < /dev/rmt/0m
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 04:44 AM
12-05-2002 04:44 AM
Re: Tar command
Worst case scenario is a chroot
In the future use fbackup since tar is a simple soul.
Restore a complete directory
/etc/frecover -xi/directory
/etc/frecover -x -i/directory1 -i/directory2
When restoring a directory, `frecover' will not overwrite an existing
file, except if the -o option is used.
It may be nice to recover relative somewhere in a directory like /tmp/local.
To restore relative, you must go first to the directory with cd, and then
use the X or F option.
cd /tmp/local; /etc/frecover -xvXi /directory
(with directory tree path )
cd /tmp/local; /etc/frecover -xvFi /directory
(without path, only files names)
Regards
Steve Steel
Quote of the moment
-------------------
"We are drowning in information but starved for knowledge."
-- John Naisbitt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 04:56 AM
12-05-2002 04:56 AM
Re: Tar command
cd to desired directory
pax -r -s ',^/,,' -f file.tar
(no need for back slashes)
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 05:17 AM
12-05-2002 05:17 AM
Re: Tar command
It is easy to remember
/^\///
four forward slashes and one backward slash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2002 05:25 AM
12-05-2002 05:25 AM
Re: Tar command
Harry's use of the comma (",") as a delimiter makes the *substitution* ('-s') 'pax' syntax easier to read than using a "/" delimiter and having to escape its dual meaning as part of a filename or directory and as a delimiter. *Any* character can be used as a delimiter. Note that the syntax mirrors that of 'sed'.
Regards!
...JRF...