Transferring files from MT2 storage to MT1 storage.

Back to documentation index

There are three tools for file transfer from MT2 to MT1 storage, scp, sftp and rsync.

The node mt2-xfer1 is used as a gateway between the locations.

Using scp to copy files and directories:

This example copies a directory called test and it’s contents from my MT2 storage to my MT1 storage

[willc@podmt1-100-89 ~]$ scp -r  mt2-xfer1:test ./
nest7grid.parms                        100%  270     0.3KB/s   00:00    
namelist.input                         100% 3821     3.7KB/s   00:00    
projection.jpg                         100%   42KB  41.8KB/s   00:00    
namelist.wps                           100% 1738     1.7KB/s   00:00    

The -r switch recursively copies the entire directory.  To copy a single file, just specify that file (or a use a wildcard specification)

willc@podmt1-100-89 mt2]$ scp  mt2-xfer1:*.sub ./
ls-dyna.sub                                            100% 1473     1.4KB/s   00:00    
mpi-ring.sub                                           100%  153     0.2KB/s   00:00    
n.sub                                                  100%   68     0.1KB/s   00:00    
sing.sub                                               100%  190     0.2KB/s   00:00    
t.sub                                                  100%  101     0.1KB/s   00:00    

Note that scp will overwrite existing files without warning.  One can make a MT1 directory to store transferred files.

[willc@podmt1-100-89 ~]$ mkdir mt2-files
[willc@podmt1-100-89 ~]$ cd mt2-files

Using sftp

sftp can also be used to copy files (but not whole directories).  It is most useful for viewing the contents of MT2 storage.

[willc@podmt1-100-89 mt2]$ sftp mt2-xfer1
Connecting to mt2-xfer1...
sftp> ls *.sub
ls-dyna.sub                  mpi-ring.sub                 n.sub                        
sing.sub                     t.sub                        
sftp> quit


When connected to mt2-xfer1 with sftp, use ? to get help with usage

Using rsync

rsync is a versatile file-copying tool.  It can be used much like scp, but it first checks to see if the file is available locally and skips the copy if it is. This is useful to keep directories in sync in different locations.


[willc@podmt1-100-89 mt2]$ rsync -v mt2-xfer1:*.sub ./
ls-dyna.sub
mpi-ring.sub
n.sub
sing.sub
t.sub

sent 106 bytes  received 2307 bytes  1608.67 bytes/sec
total size is 1985  speedup is 0.82

[willc@podmt1-100-89 mt2]$ rsync -v mt2-xfer1:*.sub ./
ls-dyna.sub
mpi-ring.sub
n.sub
sing.sub
t.sub

sent 148 bytes  received 330 bytes  318.67 bytes/sec
total size is 1985  speedup is 4.15

Note that the second time was much faster as the files already existed at MT1.  

For most users scp and sftp should be sufficient.  We will be happy to help with rsync if needed as it has many options.

There are manual pages available for all of these commands. 

$ man scp
$ man sftp
$ man rsync

Please let us know if you need assistance with any transfers.