Transferring data to Viking
There are many other ways you can copy data to and from Viking and so we will only go over some general examples here using popular programs as a basic guide. For quick reference here are the important details:
Hostname: viking.york.ac.uk
Port: 22
Protocol: SFTP
Caution
If you are not connected to the campus network, please remember you must be connected to the University VPN first.
Windows
If you are copying data from a Windows device it is recommended that you use WinSCP following their tutorials for uploading and downloading files. Using your username
and the hostname
, port
and protocol
shown above, you should be able to connect to Viking and start moving files.
If you prefer a command line interface, you can also use scp
from Powershell with the same commands as in Linux.
Linux
The most popular file transfer options for Linux are scp
and rsync
.
scp
scp
is recommended for transferring a small number of files.
It uses ssh
for data transfer and will therefore ask for passwords or passphrases if they are needed for authentication.
These examples will copy data from your device to your scratch
directory on Viking (remember to replace abc123
with your University username and <filename>
and <dirname>
with the names of the file and directory to be copied respectively).
$ scp <filename> abc123@viking.york.ac.uk:~/scratch/
$ scp -r <dirname> abc123@viking.york.ac.uk:~/scratch/
The -r
option in the second command means the directory is copied recursively.
There are many other options for scp
, as documented in the manual that can be accessed through man scp
.
To copy files from Viking back to your computer simply reverse the order of the two locations in the command, e.g. scp abc123@viking.york.ac.uk:~/scratch/<filename> .
will copy a file from Viking back to your local computer’s current directory.
rsync
rsync
is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behaviour and permit very flexible specification of the set of files to be copied.
rsync
is recommended for a large number of files because it can check what is already in place, therefore if the network is interrupted you can run the command again and it will pick up from where it was stopped.
It will only transfer files that do not exist on the other server or files that have been changed.
$ rsync -av <dirname> abc123@viking.york.ac.uk:~/scratch
$ rsync -avP --append <filename> abc123@viking.york.ac.uk:~/scratch
There are many more options you can use with rsync
which again can be viewed in the manual (man rsync
).
Tip
When transferring large amounts of data it is a good idea to use terminal multiplexing such as tmux
. This would allow you to leave the transfer running (inside a tmux
session) and not have to stay logged in yourself.
FileZilla
FileZilla is a fantastic graphical program for transferring files and can be used on both Windows, Linux, or MacOS. You can download it from their website.
To connect to Viking, enter your details in the boxes towards the top of the screen:
Host: viking.york.ac.uk
Port: 22
For the username and password, enter your IT Services credentials.
After entering these details and connecting to Viking, your Viking area will appear on the right. You will now be able to click and drag files similar to the file manager. More information can be found in the FileZilla documentation.