Commit 70fe582f authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

Fixed some issues to check if there are fastq or fastq.gz files

parent 74034f58
......@@ -58,6 +58,47 @@ Start by cloning the transfer-tool on your local machine:
git clone git@gitlab.sib.swiss:SPSP/transfer-tool.git
```
Then get inside the directory:
```bash
cd tranfer-tool
ls -la
```
Your terminal should output 3 folders (logs,outbox,sent) and 2 files (README.md, spsp) and 2 hidden files (.env, .pub). Here is a short description of each folder and file:
- **logs** - contains all the log files when you use the auto mode (log files record only errors)
- **outbox** - contains files to be sent to the SPSP server through sftp
- **sent** - contains encrypted files with their SHA256 hash that have been properly sent
- *README.md* - user guide
- *spsp* - script containing all the commands to run, type `./spsp help` to display the commands
- *.env* - setting file to be configured by the user
- *.pub* - public key of SPSP for encryption
(.git and .gitignore are juste GIT related files)
Let's start by setting up the transfer-tool. To do so, type:
```bash
./spsp init
```
This will make sure that some commands are available, that the script is executable and will also import the public key to your own list of keys.
If everything went well, congratulations, you are ready to use the transfer-tool. If not, please check the output or contact the [support](mailto:spsp-support@sib.swiss).
## Use the transfer-tool
The following commands are available:
- `./spsp compress <folder>` - compress a folder to tar.gz archive
- `./spsp encrypt <file>` - encrypts a file using gpg command and SPSP public key (which needs to be in your own GPG keys list)
- `./spsp transfer <file>` - transfers a file through sftp to SPSP server (your SSH key needs to be validated by SPSP to use this command)
- `./spsp auto`- automatically run the transfer-tool (this needs to be combined with a CRON task, see below for more information)
- `./spsp help` - displays the help
## Use the automatic mode
## Authors
* **Dillenn TERUMALAI** - *Initial work* - [dillenn.terumalai@sib.swiss](mailto:dillenn.teruamlai@sib.swiss)
......@@ -216,12 +216,12 @@ if [ $# -gt 0 ]; then
echo ""
for DIRECTORY in *; do
if [ -d "$DIRECTORY" ] && [ $DIRECTORY != $OUTBOX ] && [ $DIRECTORY != $SENT ] && [ $DIRECTORY != $LOGS ]; then
if [ -f $DIRECTORY/*.fastq* ] && [ -f $DIRECTORY/*.xlsx ]; then
if ls $DIRECTORY/*.fastq* 1> /dev/null 2>&1 && [ -f $DIRECTORY/*.xlsx ]; then
echo "SPSP: Compressing $DIRECTORY folder..."
compressFolder $DIRECTORY &> /dev/null
echo "SPSP: Sucessfully compressed!"
echo "SPSP: Removing the source and moving the tar.gz to outbox folder."
# rm -rf $DIRECTORY
rm -rf $DIRECTORY
mv $DIRECTORY.tar.gz ./outbox/.
else
echo "[`date +"%T"`] local.ERROR: Missing files (*.fastq or *.xlsx) inside ${DIRECTORY}" >> $LOGFILE
......@@ -240,7 +240,7 @@ if [ $# -gt 0 ]; then
encryptFile $FILE &> /dev/null
echo "SPSP: $FILE is now encrypted"
echo "SPSP: Removing unencrypted version of $FILE"
# rm -rf $FILE
rm -rf $FILE
echo "SPSP: Deleted!"
if [ -f "$FILE.sha256" ] && [ -f "$FILE.gpg" ]; then
echo "SPSP: Starting the transfer"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment