- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to tar a directory from one host to another us...
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
05-15-2003 01:51 PM
05-15-2003 01:51 PM
How to tar a directory from one host to another using pipe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 01:57 PM
05-15-2003 01:57 PM
Re: How to tar a directory from one host to another using pipe
# cd /dir
# tar -cf - ./* | remsh dest_host "cd /dir; tar -xf -"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 01:59 PM
05-15-2003 01:59 PM
Re: How to tar a directory from one host to another using pipe
#>cd /"source_directory or files"
#>tar cvf - . | remsh "target_machine" '(cd /"source_directory"; tar - xvf -)'
Verify that the files have been transfered to the target host.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 02:20 PM
05-15-2003 02:20 PM
Re: How to tar a directory from one host to another using pipe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 02:20 PM
05-15-2003 02:20 PM
Re: How to tar a directory from one host to another using pipe
Do a "man rhosts" to learn more. You need to set it up to give permission for remote systems to connect in without a password.
Note- remsh,rlogin are very popular, but the push is to use the secure shell command instead "ssh". This provides encrypted connections between two machines.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 02:23 PM
05-15-2003 02:23 PM
Re: How to tar a directory from one host to another using pipe
tar -cf - ./* | remsh dest_host "cd /dir; tar -xf -"
is known as a relative copy. tar backups up at the current directory, then "cd /dir" sets the current directory on the remote system and the following tar will restore folders/files relative to /dir, with all permissions, ownerships retained. Ownership is dependant that /etc/passwd has common entries between the two systems.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 02:27 PM
05-15-2003 02:27 PM
Re: How to tar a directory from one host to another using pipe
tar -cf - ./* | remsh dest_host "cd /dir; tar -xf -"
Will not copy files with "." prefixes. Shell considers them "hidden" files. Change command to-
tar -cf - ./* ./.* | remsh dest_host "cd /dir; tar -xf -"
to include ALL files.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 07:22 PM
05-15-2003 07:22 PM
Re: How to tar a directory from one host to another using pipe
Using ssh, the following would work:
tar cvf - direcroty | ssh qe2n1 cd /new/directory/path\; tar xf -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 10:04 PM
05-15-2003 10:04 PM
Re: How to tar a directory from one host to another using pipe
(ie;
cd
tar -cbf 64 - . | (remsh dest_host "cd /dir; tar -xbf 64 -"
You can also use the find command piped to cpio to do the same thing.
Both solutions do not handle files bigger than 2Gb. You will have to use fbackup to get those (or cp -p).
find ./ -depth | remsh dest_host "cpio -pmudlx /
You will probably have to play with the remsh or ssh portion of the command to get cpio to work, as I have never tried it from machine A to machine B (except over "YIKES" NFS).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 11:15 PM
05-15-2003 11:15 PM
Re: How to tar a directory from one host to another using pipe
How about using the -C
Mariani Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 11:59 PM
05-15-2003 11:59 PM
Re: How to tar a directory from one host to another using pipe
There is another way, use "rexec" instead of "remsh" - you are prompted for the remote password but otherwise the effect is exactly the same.
You can also use rexec -l
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2003 10:06 AM
05-17-2003 10:06 AM
Re: How to tar a directory from one host to another using pipe
On the new machine, cd to the dest directory then execute:
date; remsh
This will also let you know how long it took to complete.
As mentioned in other notes, you have to set up your .rhosts properly and enable remsh on the source machine, but it worked great for me.
Good luck!
Seth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2003 06:43 AM
05-18-2003 06:43 AM
Re: How to tar a directory from one host to another using pipe
Maybe less time on a slow net
tar -cf - ./* ./.*| gzip > | remsh dest_host "cd /dir; gzcat tarfile.tar.gz | tar -xvf -"
Just idea syntax probably wrong.