The File Transfer Method

The classic example for this method is the FTP program. Unfortunately it uses plain text passwords which go over the net unencrypted, therefore I don't recommend it for access of personal files (Anonymous ftp is no problem). The ssh protocol does not suffer from this problem. It provides an encrypted channel between two computers, which can be used for interactive work as well as for file transfer.

SSH for file transfer on Unix

For simple file copying you can use the scp command. It is part of the (open)ssh package which you can find on most Unix systems these days:

the first example copies a single file from top-level directory of your Tardis account into the current directory (Note the dot). The second one copies a whole directory. For more information on scp check man scp

scp -p username@login.ee.ethz.ch:myfile.txt .
scp -rp username@login.ee.ethz.ch:topleveldir/ .

There are several other utilities which use ssh to provide the communication channel but implement their own file transfer methods. The most popular is probably rsync. It usees ssh to connect to the remote host. The nice thing about rsync is that it will only transfer data which is not already present on the local computer. This means you can repeatedly copy a whole directory and rsync will only transfer the changes. It does this even within files, so if you have a 200 MB file and change 10 bytes rsync will find them and only transfer a few bytes. To further improve performance rsync can also use the --compress option to compress the data for transfer.

Rsync transfers data only in one direction. This means that you have to be careful when synchronizing directories between two machines. The UNISON tool on the other hand is capable of synchronizing in two directions at once. I use this to keep my Tardis account and my laptop synchronized. Unison can be setup so that it will display a list of files that have been modified and in which direction they are going to be transfered. When the files have been modified at both ends it will even offer to use an external merging program to unify the files. For large files with small changes, Unison will also only transfer the changes within the file. Read all about it on The Unison Website. Unison is already installed on Tardis and on the ISG.EE Debian Image.

SSH for file transfer on Windows

There are Windows ports of scp, rsync and unison available, so you could use the same approach as on Unix. A more Windows like approach is to use the windows scp client from http://winscp.sourceforge.net/eng/. It offers an explorer like file access facility for transferring files to and from your tardis account in exactly the same way as you are used to, with explorer on the local filesystem.


CategoryEDUC

Services/FileAccess/FileTransfer (last edited 2013-09-09 14:24:52 by alders)