Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


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  
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; 04-14-2019 at 10:47 AM.. Reason: Adding more details
# 2  
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  
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  
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:
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
Copy a file from local host to a list of remote hosts --- perl script
siva kumar
Hi friends, i need to prepare a script ( in perl) i have a file called "demo.exe" in my local unix host. i have a list of remote hosts in a file "hosts.txt" now i need to push "demo.exe" file to all the hosts in "hosts.txt" file. for this i need to prepare a script(in perl, but shell...... Shell Programming and Scripting
5
Shell Programming and Scripting
aix tcp wrappers hosts.allow hosts.deny?
wf201626
hi all just installed the netsec.options.tcpwrapper from expansion pack, which used to be a rpm, for my aix 6.1 test box. it is so unpredictable. i set up the hosts.deny as suggested for all and allow the sshd for specific ip addresses/hostnames. the tcpdchk says the hosts allowed and...... AIX
0
AIX
Launch remote gui apps in remote hosts
zauberberg
Hi, I've been looking for a way to execute a console program (is in windows but by now I accept the linux way) from a linux machine, but this program has to be opened in the remote side. Linux machine acts only as a "signaling" host. My program has to open the camera in the remote side, but only...... Debian
7
Debian
Copy files between remote hosts
agasamapetilon
Don't know if its correct to write into this topic but how can I copy files from a Windows machine to a UNIX system?... UNIX for Dummies Questions & Answers
2
UNIX for Dummies Questions & Answers
Copy a file to multiple hosts
sumsriva
Hi, I need to copy a file ( say 1MB file ) to multiple hosts( no of machines is huge). What would be the most optimal way of doing it with minimal user intervention ? Thanks, Sumit... UNIX for Advanced & Expert Users
5
UNIX for Advanced & Expert Users

Featured Tech Videos