How to copy a tar file on a series of remote hosts and untar it on those hosts?


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 1 Week Ago
How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh.
Actions to perform within a single ssh session via shell script
- copy a file
- untar at destination (remote host)

OS : Linux RHEL6

Last edited by sankasu; 1 Week Ago at 09:47 AM.. Reason: Adding more details
# 2  
Old 1 Week Ago
Moderator's Comments:
Mod Comment Moved to Solaris forum from a generic contact us forum.


Please describe your operating system in details.

We cannot read minds and most of us here do not have superpowers to see into computer systems using our imagination.
# 3  
Old 6 Days Ago
Hello sankasu,

I have a few to questions pose in response first. I'm sure with over 50 posts, you will know what we need:-
  • Is this homework/assignment? There are specific forums for these.
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.




Kind regards,
Robin
# 4  
Old 5 Days Ago
Most cool: copy it via the stdin stream!
Code:
ssh remotehost "cd /destination && tar xvf -" < file.tar

The ssh is locally fed from the file.tar, and on the remote side the tar sucks from it.
These 2 Users Gave Thanks to MadeInGermany For This Post:
jim mcnamara (5 Days Ago) rbatte1 (4 Days Ago)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Making output of data from remote hosts smaller SkySmart Shell Programming and Scripting 4 10-19-2015 03:24 PM
SSH to remote hosts in shell scripting kumar85shiv Shell Programming and Scripting 3 03-31-2014 02:45 PM
Copy a file from local host to a list of remote hosts --- perl script siva kumar Shell Programming and Scripting 5 05-02-2013 01:14 AM
aix tcp wrappers hosts.allow hosts.deny? wf201626 AIX 0 08-15-2012 03:43 PM
Running a script on multiple remote hosts at once mrskittles99 Shell Programming and Scripting 3 07-18-2012 12:08 PM
Port Time outs on Remote Hosts SkySmart UNIX for Advanced & Expert Users 2 04-29-2012 05:49 PM
remote hosts and wide output? Habitual UNIX for Advanced & Expert Users 7 12-09-2011 07:54 AM
Launch remote gui apps in remote hosts zauberberg Debian 7 10-24-2011 04:55 PM
Check executed commands from remote hosts @dagio Solaris 8 10-08-2010 08:14 AM
How to Know is a Remote hosts have open port andresguillen UNIX for Dummies Questions & Answers 3 10-29-2009 03:35 PM
ftp into remote hosts kodermanna UNIX for Advanced & Expert Users 1 05-21-2009 12:57 AM
Copy files between remote hosts agasamapetilon UNIX for Dummies Questions & Answers 2 09-01-2008 06:21 PM
Copy a file to multiple hosts sumsriva UNIX for Advanced & Expert Users 5 09-18-2007 03:42 AM
remote hosts access problem on solaris Terrible Shell Programming and Scripting 1 07-03-2006 02:00 PM
hosts.allow & hosts.deny Sorrento UNIX for Dummies Questions & Answers 2 08-18-2005 09:25 PM