Use > Server Automation > SA Global Shell > Global Shell examples > Copying files between the OGFS and a development server

Copying files between the OGFS and a development server

You can securely copy files between the OGFS and a server that is not part of Server Automation. To copy the files:

  1. On a host that is not an SA core server or a managed server, open a terminal window.
  2. In the terminal window, enter either the scp, sftp, or rsync command and specify port 2222, your SA user name, and the host running the OGFS.

The following three scp examples perform the same operation: They copy the file myscript.sh from the local machine to the file /home/jdoe/myscript.sh in the OGFS. The SA user is jdoe and the host running the OGFS is 192.168.166.178.

scp -P 2222 myscript.sh jdoe@192.168.166.178:myscript.sh
scp -P 2222 myscript.sh jdoe@192.168.166.178:/home/jdoe
scp -P 2222 myscript.sh jdoe@192.168.166.178:

The following example copies myscript.sh from the home directory of jdoe in the OGFS to the local machine:

scp -P 2222 jdoe@192.168.166.178:myscript.sh myscript.sh

The following sftp example copies myscript.sh from the local machine to the OGFS:

sftp -oPort=2222 jdoe@192.168.166.178
Connecting to 192.168.166.178...
 
Global Shell
 
jdoe@opsware's password:
sftp> put myscript.sh
. . . .

The following rsync example transfers files from /path on the local machine to
/other/path in the OGFS:

rsync -av -e "ssh -p 2222" /path \
jdoe@192.168.166.178:/other/path