Transfer Files Remotely

Using rsync in Linux

Rsync’s basic operation allows you to copy directories and files to another location (remotely or locally). It also has many features that make it a very powerful copy tool. Some examples are below:

Sync files to and from a server:x
(only modified files will be copied, and files that are newer on the destination will not be overwritten)

Copy to a server:

rsync -av -u ~/Desktop/data  username@deneb.math.ualberta.ca:

This copies the data directory located on the Desktop of the computer to username’s home directory on deneb.math.ualberta.ca (-av is archive and verbose, -u is for ‘update’ which means newer files on the destination won’t be overwritten)

Copy from a server:

rsync -av -u username@deneb.math.ualberta.ca:data  ~/Desktop/

This copies the data directory located in the username’s home directory on deneb.math.ualberta.ca to the Desktop of the computer.

The above is a convenient way to transfer a large number of data files quickly and easily to a remote server and as a backup method as only modified files are sent.

 

WinSCP to Upload and Download Remote Files

Use the following guide to get setup and familiar with WinSCP:  http://wiki.dreamhost.com/WinSCP_Setup

WinSCP looks like the following allowing you to transfer files from your computer (left side) to the remote server (right side):

Mount Remote Files Locally Using SSHFS

SSHFS allows you to mount a remote file space onto your local computer so that it appears like a local disk drive. This makes it convenient to open remote files using your own computers software (such as viewing PDFs) without having to download the file.

note – SSHFS  may not detect changes if they are made on the remote server instead of through SSHFS, such as using a text editor on the server while having SSHFS connected. So when using SSHFS, it’s recommended not to modify a file on the remote server and then trying to access that same file through SSHFS. If it is unavoidable, you can try refreshing the local directory on your computer to try updating the local file view.

Windows
(note – it is not clear if Windows 8 is supported)

Follow this great guide:  http://linhost.info/2012/09/sshfs-in-windows/

 

Mac OS X

Install OSXFUSE and then SSHFS from the below link.

http://osxfuse.github.com/

Then run the following command, changing user to your username on the remote server and localfolder to a folder you’ve created on your Desktop. This folder will then contain the contents of the remote folder on the server.

sshfs user@deneb.math.ualberta.ca:/home/user ~/Desktop/localfolder

To unmount, use the following command:

fusermount -u ~/Desktop/localfolder

 

Ubuntu

Follow the below guide, which includes all the information required to get SSHFS setup in the latest Ubuntu Linux:

http://www.howtoforge.com/mounting-remote-directories-with-sshfs-on-ubuntu-11.10