Useful Stuff

Copying data to and from Comanche using ''rsync''

You will often want to copy data to and from comanche:

The best command to move data securely from a Linux machine is rsync. To see how to use it, use

  $ man rsync
or
  $ info rsync

This will work for those of you using Linux/Unix/OSX and probably also for those of you using mobaxterm.

Use rsync as follows

  $ ls
  prac1     prac2     prac3

This means I have these three directories. Say I want to copy the data from prac2 to my own laptop. To do this I use:

  $ rsync -avz prac2 alston@mylaptop.qmul.ac.uk:~/ESM/lab/

Let's look at this in detail:

You will be prompted for your password before the copy progresses.

Note

When copying files, keep in mind that poset has the same home file system as comanche so you can just as well copy files to and from poset.

Important What if you want to copy the contents of a directory and all sub-directories?

Then use:

  • $ rsync -r -avz prac2 alston@mylaptop....

The only addition is the -r which forces rsync to act recursively on prac2 and it then copies all the contents of prac2, including files and sub-directories.

Important To force rsync to skip files you do not want use

  • $ rsync -r -avz --exclude '*.b' prac2 alston@mylaptop....

This will exclude all files that end in .b.

If you have a long list of files you'd like to exclude then create a file called .rsyncx in your home directory and put the list of patterns in it like so:

  • $ cd $ more .rsyncx
  • .b
  • .c
  • .db

Here, files ending in .b, .c and .db will be skipped.

AJMPublic/teaching/electronic-structure/useful_stuff (last edited 2021-04-14 13:56:59 by apw109)