Passer au contenu principal

SWITCHfilesender from the cluster

Switch Filesender

Filesender is a service provided by SWITCH to transfer files over http. Normally files are uploaded via a web browser but this is not possible from the DCSR clusters.

In order to avoid having to transfer the files to your local computer it is possible to use the Filesender command line tools as explained below

 

Configuring the CLI tools

 

Connect to https://filesender.switch.ch then go to the profile tab

Screenshot 2022-01-13 at 15.14.02.png

Then click on "Create API secret" to generate a code that will be used to allow you to authenticate

Screenshot 2022-01-13 at 15.14.37.png 

This will generate a long string like

ab56bf28434d1fba1d5f6g3aaf8776e55fd722df205197

This code should never be shared 

Then connect to Curnagl and run the following commands to download the CLI tool and the configuration

cd

mkdir ~/.filesender

wget https://filesender.switch.ch/clidownload.php -O filesender.py

wget https://filesender.switch.ch/clidownload.php?config=1 -O ~/.filesender/filesender.py.ini

You will then need to edit the ~/.filesender/filesender.py.ini file using your preferred tool

You need to enter your username as show in the Filesender profile and the API key that you generated

Note that at present, unlike the other Switch services this is not your EduID account!

[system]
base_url = https://filesender.switch.ch/filesender2/rest.php
default_transfer_days_valid = 20

[user]
username = Ursula.Lambda@unil.ch
apikey = ab56bf28434d1fba1d5f6g3aaf8776e55fd722df205197

 

Transferring files

 

Now that we have done this we can transfer files - note that the modules must be loaded in order to have a python with the required libraries.

[ulambda@login ~]$ module load gcc python

[ulambda@login ~]$ python3 filesender.py -p -r ethz.collaborator@protonmail.ch results.zip 

Uploading: /users/ulambda/results.zip 0-5242880 0%
Uploading: /users/ulambda/results.zip 5242880-10485760 6%
Uploading: /users/ulambda/results.zip 10485760-15728640 11%
Uploading: /users/ulambda/results.zip 15728640-20971520 17%
Uploading: /users/ulambda/results.zip 20971520-26214400 23%
Uploading: /users/ulambda/results.zip 26214400-31457280 29%
Uploading: /users/ulambda/results.zip 31457280-36700160 34%
Uploading: /users/ulambda/results.zip 36700160-41943040 40%
Uploading: /users/ulambda/results.zip 41943040-47185920 46%
Uploading: /users/ulambda/results.zip 47185920-52428800 52%
Uploading: /users/ulambda/results.zip 52428800-57671680 57%
Uploading: /users/ulambda/results.zip 57671680-62914560 63%
Uploading: /users/ulambda/results.zip 62914560-68157440 69%
Uploading: /users/ulambda/results.zip 68157440-73400320 74%
Uploading: /users/ulambda/results.zip 73400320-78643200 80%
Uploading: /users/ulambda/results.zip 78643200-83886080 86%
Uploading: /users/ulambda/results.zip 83886080-89128960 92%
Uploading: /users/ulambda/results.zip 89128960-91575794 97%
Uploading: /users/ulambda/results.zip 91575794 100%

A mail will be sent to ethz.collaborator@protonmail.ch who can then download the file