How to rsync remotely to the cluster: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created page with "Here are scripts that allow you to copy files from outside the network to inside the network in one step. Thanks to Matt! Make two script on the PATH, (I've done it to primus...")
 
No edit summary
 
Line 29: Line 29:


Then to use it,  
Then to use it,  
 
open_primus
open_primus
localhost with port 5000 effectively is primus, eg
 
rsync -Phavz 'ssh -p5000' /tmp/abc.txt localhost:/tmp/
# localhost with port 5000 effectively is primus, eg
will copy a file form the current computer to primus  
# rsync -Phavz 'ssh -p5000' /tmp/abc.txt localhost:/tmp/
close_primus
# will copy a file form the current computer to primus  
 
close_primus


[[Category:Tutorials]]
[[Category:Tutorials]]
For security, contact [[sysadmin]]s for small but important additional information.
For security, contact [[sysadmin]]s for small but important additional information.

Latest revision as of 20:12, 17 March 2014

Here are scripts that allow you to copy files from outside the network to inside the network in one step. Thanks to Matt!

Make two script on the PATH, (I've done it to primus, but you can chose the destination)

open_primus

#!/bin/bash                                                                                                                                     
LOCAL_PORT=5000
GATEWAY_HOST={portal machine}
GATEWAY_PORT=22
REMOTE_HOST=primus.fully.qualified.name
REMOTE_PORT=22
SSH_CTRL_PATH=~/.ssh-tunnel-${GATEWAY_HOST}
ssh -p 22 -L ${LOCAL_PORT}:${REMOTE_HOST}:${REMOTE_PORT} ${GATEWAY_HOST}  -N -f -M -S ${SSH_CTRL_PATH}

and close_primus

#!/bin/bash                                                                                                                                     
LOCAL_PORT=5000
GATEWAY_HOST={portal machine}
GATEWAY_PORT=22
REMOTE_HOST=primus.fully.qualified.name
REMOTE_PORT=22
SSH_CTRL_PATH=~/.ssh-tunnel-${GATEWAY_HOST}
ssh -S ${SSH_CTRL_PATH} -O exit ${GATEWAY_HOST}

Then to use it,

open_primus

localhost with port 5000 effectively is primus, eg

rsync -Phavz 'ssh -p5000' /tmp/abc.txt localhost:/tmp/

will copy a file form the current computer to primus

close_primus

For security, contact sysadmins for small but important additional information.