transferring directory from one unix server to another unix server?

I would like to transfer directory "TestApp" from unix server "A" to Unix server "B". Can you please tell me how I can do this via command line?

Please let me know if you have any questions.Thanks
g46905Asked:
Who is Participating?
 
biraConnect With a Mentor Commented:
if you have scp , from server A you run:
scp -r TestApp serverB:/path

0
 
g46905Author Commented:
what is scp?
0
 
biraCommented:
    scp - secure copy (remote file copy program)

SYNOPSIS
     scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[user@]host1:]file1 [...] [[user@]host2:]file2

DESCRIPTION
     scp copies files between hosts on a network.  It uses ssh(1) for data
     transfer, and uses the same authentication and provides the same security
     as ssh(1).  Unlike rcp(1), scp will ask for passwords or passphrases if
     they are needed for authentication.

     Any file name may contain a host and user specification to indicate that
     the file is to be copied to/from that host.  Copies between two remote
     hosts are permitted.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
g46905Author Commented:

> scp -r TestApp serverB:/path

dont we need to specify the user Id and password of the remote server?
0
 
biraCommented:
it will ask you for the user/passwd
run it as root

what kind of unix you have ?
0
 
g46905Author Commented:
sun solaris...

> run it as root

I am not familiar. can you provide an example?

Thanks,
0
 
biraCommented:
to run it as root you normally should be the system
administrator.
but if you are not the administrator, you can run the
scp command with your own account, since you known
the password of the user/passwd at the remote host.

0
 
JJSmithCommented:

If you are using Sun Solaris it may be worth looking up 'rdist' is is by far an elegant method of moving files between servers - should the need to do so, be a frequent requirement.

Cheers
JJ.
0
All Courses

From novice to tech pro — start learning today.