Skip to content

Data transfer to/from Rackham using rsync

There are multiple ways to transfer files to or from Rackham.

Here it is described how to do file transfer to/from Rackham using rsync. rsync can be used in scripts for regular file transfer. However, rsync shines by providing a so-called 'delta' file transfer: when you transfer files twice, rsync will only transfer the files that have changed. This is ideal for backups.

Procedure

Prefer a video?

See this procedure as a video at YouTube.

1. Start a terminal on your local computer

Start a terminal on your local computer

2. Transfer files to Rackham

You can transfer files to Rackham by:

2a. Transfer individual files to Rackham

On local computer, do:

rsync [my_local_file] [username]@rackham.uppmax.uu.se:[target_folder]

where

  • [my_local_file] is the path to your local file
  • [target_folder] is the path of the folder you want to copy your file to
  • [username] is your UPPMAX username

for example:

rsync my_local_file.txt sven@rackham.uppmax.uu.se:/home/sven/

If asked, give your UPPMAX password. You can get rid of this prompt if you are using an SSH key pair.

2b. Transfer all files in a folder to Rackham

On local computer, do:

rsync --recursive my_folder [username]@rackham.uppmax.uu.se:[target_folder]

where

  • [target_folder] is the target folder
  • [username] is your UPPMAX username

for example:

rsync --recursive my_folder sven@rackham.uppmax.uu.se:/home/sven/

If asked, give your UPPMAX password. You can get rid of this prompt if you are using an SSH key pair.

Note that in rsync, a slash (/) matters:

Command Effect
rsync --recursive my_folder sven@rackham.uppmax.uu.se:/home/sven Will put the files in my_folder in the Rackham home folder
rsync --recursive my_folder sven@rackham.uppmax.uu.se:/home/sven/ Will put the folder my_folder in the Rackham home folder

3. Transfer files from Rackham to you local computer

You can transfer files from Rackham to your local computer by:

3a. Transfer individual files from Rackham to your local computer

On your local computer, do:

rsync [username]@rackham.uppmax.uu.se:[path_to_file] .

where

  • [path_to_file] is the path to the file you want to download
  • [username] is your UPPMAX username
  • . means 'in the current folder of my local computer' or 'here'

for example:

rsync sven@rackham.uppmax.uu.se:/home/sven/my_file.txt .

If asked, give your UPPMAX password. You can get rid of this prompt if you are using an SSH key pair.

3b. Transfer all folders from Rackham to you local computer

On your local computer, do:

rsync --recursive [username]@rackham.uppmax.uu.se:/[source_folder] .

where

  • [source_folder] is the path to the folder you want to download
  • [username] is your UPPMAX username
  • . means 'in the current folder of my local computer' or 'here'

for example:

rsync --recursive sven@rackham.uppmax.uu.se:/home/sven/my_folder .

If asked, give your UPPMAX password. You can get rid of this prompt if you are using an SSH key pair.