RE: Copy a tar file from remote server

From: Tobias Speckbacher (TSpeckbacher_at_quova.com)
Date: 03/17/05

  • Next message: Bjorn Andersen: "RHEL ES4 vs. WS4"
    Date: Thu, 17 Mar 2005 12:18:34 -0800
    To: "General Red Hat Linux discussion list" <redhat-list@redhat.com>
    
    

    > -----Original Message-----
    > From: redhat-list-bounces@redhat.com [mailto:redhat-list-
    > bounces@redhat.com] On Behalf Of Sanjay katiyar
    > Sent: Thursday, March 17, 2005 5:11 AM
    > To: General Red Hat Linux discussion list
    > Subject: RE: Copy a tar file from remote server
    >
    > As I supply password for user tomcat it connects to
    > the remote server and start showing $ prompt.
    > If I logged off from remote machine then it lost the
    > connection and next command is not executed.
    >
    > Actully I even dont want to supply passward manully,
    > Is there any way to automate all these steps in a
    > script file?
    >
    > 1. connect to remote machine using ssh
    > 2. tar some dir
    > 3. copy that tar file to my local machine.

    ssh user@host "tar cvfz - /somedir /someotherdir" | cat > my.tar.gz

    This should do the trick :)

    -T

    >
    > Thanks,
    > Sanjay
    >
    > --- "Smith, Albert" <Albert.Smith@genexservices.com>
    > wrote:
    > > The reason it's failing is that you are trying to
    > > execute remote
    > > commands from a locally running script. Once you log
    > > off the remote
    > > machine the script will continue to execute
    > >
    > > #!/bin/sh
    > >
    > > Date=`date -I`
    > > ssh -l tomcate www.MyRemoteHost.net 'tar -cvf \
    > > /opt/tomcat4/MyDir/bk-$Date.tar
    > > /opt/tomcat4/webapps/MyApp'
    > >
    > > scp tomcat@www.MyRemoteHost.net:MyDir/bk-$Date.tar
    > > .
    > >
    > > Albert Smith
    > > Sr. Unix Systems Administrator
    > > HPCSA, RHCT
    > > Genex Services
    > > 440 E. Swedesford Rd.
    > > Wayne, PA 19087
    > > albert.smith@genexservices.com
    > > (610) 964-5154
    > >
    > >
    > > > -----Original Message-----
    > > > From: redhat-list-bounces@redhat.com
    > > > [mailto:redhat-list-bounces@redhat.com] On Behalf
    > > Of Sanjay katiyar
    > > > Sent: Thursday, March 17, 2005 5:58 AM
    > > > To: General Red Hat Linux discussion list
    > > > Subject: Copy a tar file from remote server
    > > >
    > > >
    > > > I am trying to connect a remote machine thruogh
    > > ssh and want
    > > > to tar one directory and copy the tar file in my
    > > local
    > > > machine. My script file looks like this
    > > > **************************
    > > > !/bin/sh
    > > >
    > > > Date=`date -I`
    > > >
    > > > ssh -l tomcat www.MyRemoteHost.net
    > > >
    > > > tar -cvf /opt/tomcat4/MyDir/bk-$Date.tar
    > > /opt/tomcat4/webapps/MyApp/
    > > >
    > > > scp tomcat@www.MyRemoteHost.net:MyDir/bk-$Date.tar
    > > .
    > > > **************************
    > > > When I run this script in my local machine it ask
    > > for
    > > > password of user tomcat, after supplying the
    > > password it
    > > > connects to the remote machine and does not
    > > execute the rest
    > > > of the commands.
    > > >
    > > > Can any one suggest the right script?
    > > >
    > > > Thanks in advance.
    > > >
    > > > Sanjay
    > > >
    > > >
    > >
    > ______________________________________________________________
    > > > __________
    > > > Yahoo! India Matrimony: Find your life partner
    > > online Go to:
    > > > http://yahoo.shaadi.com/india-matrimony
    > > >
    > > > --
    > > > redhat-list mailing list
    > > > unsubscribe
    > >
    > mailto:redhat-list-request@redhat.com?subject=unsubscribe
    > > >
    > > https://www.redhat.com/mailman/listinfo/redhat-list
    > > >
    > > >
    > >
    > >
    > > --
    > > redhat-list mailing list
    > > unsubscribe
    > >
    > mailto:redhat-list-request@redhat.com?subject=unsubscribe
    > > https://www.redhat.com/mailman/listinfo/redhat-list
    > >
    >
    >
    ________________________________________________________________________
    > Yahoo! India Matrimony: Find your life partner online
    > Go to: http://yahoo.shaadi.com/india-matrimony
    >
    > --
    > redhat-list mailing list
    > unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    > https://www.redhat.com/mailman/listinfo/redhat-list

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Bjorn Andersen: "RHEL ES4 vs. WS4"

    Relevant Pages

    • Re: Executing a file remotely
      ... >That depends on how you'd execute any command on a remote machine. ...
      (comp.lang.python)
    • Re: Remote Execution of Windows GUI
      ... > I am currently trying to find a way to remotely execute an application such> that the GUI will actually show up on the remote host. ... have computer1 tell computer2 to execute calc.exe, such that> the calculator actually does show up for the currently logged in user of ... > The process is running on that remote machine, ...
      (microsoft.public.dotnet.distributed_apps)
    • Re: Copy a tar file from remote server
      ... do like follow to generate a rsa key pairs: ... > the remote server and start showing $ prompt. ... > If I logged off from remote machine then it lost the ... >>machine the script will continue to execute ...
      (RedHat)
    • RE: Listing processes and killing processes through command line in Windows
      ... >>However i'm not able to execute the commands on a remote machine, ... need to have to execute the commands on a remote pc? ...
      (Security-Basics)
    • Re: Accessing PCs that connect to SBS server 2003 via VPN
      ... We have dual nic + router configuration. ... subnet from the external nic which is connected to the router. ... run the Remote Access Wizard (Server Management | To ... update the actual user profile on the remote machine with your ...
      (microsoft.public.windows.server.sbs)