@@ -22,8 +22,31 @@ If you want to be able to use the tool smoothly, make sure that you have:
- OS: macOS or Linux - This script can only run on those operative systems
- SSH: public key uploaded - This script is assuming that you have generated and transferred your public SSH key to the SPSP SFTP Server. If not, please read the [Installation](#installation) chapter
- GPG: gpg avaiable - This script uses GPG to encrypt the data, make sure that you can run this command (`which gpg`)
- (Optional)CRON: automatic mode - If you want to activate the automatic mode of the transfer-tool make sure that you can setup a CRON task
- (Optional)CRON: automatic mode - If you want to activate the automatic mode of the transfer-tool make sure that you can setup a CRON task
## Upload the SSH public key
Before using the script, you need to make sure that you create an SSH key pair for user authentication.
Start by generating a key pair, make sure to replace `user` by your specific ID provided by the board of SPSP. Open a terminal and type:
```bash
ssh-keygen -t rsa -b 4096 -C user@spsp.sib.swiss #PLEASE REPLACE USER WITH YOUR OWN ID
```
You will be asked to `Enter file in which to save the key (/Users/user/.ssh/id_rsa):`, leave it by default by typing the return key.
Then you will be asked to `Enter passphrase (empty for no passphrase):`, leave it empty and type two times the return key to confirm your choice.
You will then be prompted that your SSH public key has been saved to `/Users/user/.ssh/id_rsa.pub`. This is your public key that needs to be authorized on the SPSP SFTP Server.
For the next step, you will need to upload your key. Start by copying your key. Type the following to display the public key:
```bash
cat /Users/user/.ssh/id_rsa.pub #PLEASE REPLACE user WITH YOUR LOCAL ACCOUNT
```
Then click [here](spsp.sib.swiss/upload-key) to send your key. Once the key has been validated, you will notified by mail.
commands="$commands compress <folder> Compress the ${COL_LGREEN}FASTQ${COL_RESET} files to ${COL_LYELLOW}tar.gz${COL_RESET} file\n"
commands="$commands compress <folder> Compress the ${COL_LGREEN}FASTQ${COL_RESET}and ${COL_LGREEN}XSLX${COL_RESET}files to ${COL_LYELLOW}tar.gz${COL_RESET} file\n"
commands="$commands encrypt <compressed file> Encrypt a ${COL_LGREEN}tar.gz${COL_RESET} file using a public key\n"
commands="$commands transfer <encrypted file> Transfer the encrypted file using ${COL_LGREEN}sftp${COL_RESET}\n"
commands="$commands auto Automatically run the commands in a correct order to ${COL_CYAN}compress${COL_RESET}, ${COL_GREEN}encrypt${COL_RESET} & ${COL_MAGENTA}transfer${COL_RESET}\n"
commands="$commands transfer <encrypted file> Transfer the encrypted file using ${COL_LGREEN}SFTP${COL_RESET}\n"
commands="$commands auto Automatically run the commands to ${COL_CYAN}Compress${COL_RESET}, ${COL_GREEN}Encrypt${COL_RESET} & ${COL_MAGENTA}Transfer${COL_RESET}\n"
commands="$commands help Shows Help screen\n"
commands="$commands logs Displays the content of the main log \n"
options="${COL_LYELLOW}Options:\n${COL_RESET}"
options="$options --help, -h Shows Help (this screen)\n"