Operating System - HP-UX
1834202 Members
2788 Online
110066 Solutions
New Discussion

Re: Remote installation script

 
PVR
Valued Contributor

Remote installation script

Hi !

I want to untar a tar file into a remote machine through a script.

Tar file is in a directory named /testing in the remote machine and it has to be untared in /usr/local.

Thanks in advance !
Don't give up. Try till success...
7 REPLIES 7
Arunvijai_4
Honored Contributor

Re: Remote installation script

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=675638

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
VEL_1
Valued Contributor

Re: Remote installation script



Try to use tar command with ssh.

tar -cf - /some/file | ssh host.name tar -xf - -C /destination
Sandman!
Honored Contributor

Re: Remote installation script

Use remsh for this...man remsh(1):

# remsh -n "cd /usr/local; tar xvf /testing/ ."
baiju_3
Esteemed Contributor

Re: Remote installation script

tar syntax for remote copy is


tar -pcvf - * | remsh server "cd /path ; tar -xvf -"




Thanks,
BL.



Good things Just Got better (Plz,not stolen from advertisement -:) )
Raj D.
Honored Contributor

Re: Remote installation script

Hi PVR,

At local server run the script :

########################################
# untar tar file into a remote server.
########################################
tar -cvf testing.tar /testing
scp testing.tar remote_svr:/usr/local/
ssh remote_svr "cd /usr/local ; tar -xvf testing.tar"
echo " untar done .. pls check remote server /usr/local/testing/ directory "

########################################


Note: If ssh keygen is set , it can be done without interuption. Else need to provide passowrd as it prompts.

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Devender Khatana
Honored Contributor

Re: Remote installation script

Hi Pramod,

You can use one of the convenient methods mentioned above. But how your tar archive was created?

It is always good to create tar archives with relative path. When you have to restore a file to other location it can be done easily with such files.

Best Regards,
Devender
Impossible itself mentions "I m possible"
PVR
Valued Contributor

Re: Remote installation script

thanks to all !!
Don't give up. Try till success...