- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: tar problem
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
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
тАО12-11-2008 12:22 PM
тАО12-11-2008 12:22 PM
Being in server1, Im trying to to tar files from server2 and untar directly in server3 in one line. here the code i have tried.
ssh -l username 2ndservername tar -cf - /home/foldername|ssh -l usernrame 3rdservername " cd /home/tuxtnk/copied/ && tar -xvf -"
My another code is working which tar file in the server1 (i.e. from the current server) and untar in the server3 but i am trying to between 2 different remote machines from the script in the current machine.
tar -cf - /home/foldername|ssh -l usernrame 3rdservername " cd /home/tuxtnk/copied/ && tar -xvf -"
I will really appreciate the help
thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 12:28 PM
тАО12-11-2008 12:28 PM
Re: tar problem
Please check the response code on this command:
tar -cf - /home/foldername|ssh -l usernrame 3rdservername " cd /home/tuxtnk/copied/ && tar -xvf -"
Looks like a syntax issue to me.
maybe -xvf -
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 12:40 PM
тАО12-11-2008 12:40 PM
Re: tar problem
i.e.
ssh -l username 3rdservername tar -cf - /home/foldetotar|ssh -l username 2ndservername " cd /home/foldertountar && tar -xvf -"
The error I got is
Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh: Could not resolve hostname 2ndservername cd /home/foldertountar && tar -xvf : host nor service provided, or not known
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 12:45 PM
тАО12-11-2008 12:45 PM
Re: tar problem
A chain like this works to reach "server-3" from "server-2" having been initiated on "server-1":
# ssh host2 "uname -a;hostname;ssh host3 uname -a;hostname"
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 12:53 PM
тАО12-11-2008 12:53 PM
Re: tar problem
I dint get your solution. could you please explain it to me syntatically so that i can try in my terminal. I will really appreciate it
thanks alot
pareshan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 01:03 PM
тАО12-11-2008 01:03 PM
Re: tar problem
> I didnt get your solution. could you please explain it to me syntatically so that i can try in my terminal. I will really appreciate it
The point was that you are not piping anything as you tried to do, but rather are "hopping" server-to-server, and running something when you "land".
I think you need to 'scp' the tar archive in one step and then in another step un-tar the copied archive.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 01:18 PM
тАО12-11-2008 01:18 PM
Re: tar problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 01:38 PM
тАО12-11-2008 01:38 PM
Solution> so that means there is no[w] way that i can do it in one step??
Define "one step". How much do you want to cram on a commandline? Do yourself a favor and write a simple script in a file that you then launch just like any command.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 01:55 PM
тАО12-11-2008 01:55 PM
Re: tar problem
thank you very much JRF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 02:52 PM
тАО12-11-2008 02:52 PM
Re: tar problem
> My script is becoming bigger and bigger and I have to use this kind of commands several times thats why I was trying to find a way to make it short
That's why you write functions or subroutines and pass arguments to them.
Regards!
...JRF...