From 12eb4084290a1fa5056e6c0250bb810ff717602f Mon Sep 17 00:00:00 2001 From: Antonio Calanducci Date: Thu, 11 Jul 2024 08:45:35 +0000 Subject: [PATCH] Add debug mode and additional loggin --- Dockerfile | 2 +- copy_files.sh | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0815c68..030b3dd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:latest RUN apk update && \ - apk add --no-cache openssh-client nfs-utils zstd + apk add --no-cache openssh-client zstd tar # RUN mkdir -p /mnt/nfs diff --git a/copy_files.sh b/copy_files.sh index a8eb01e..8227df3 100644 --- a/copy_files.sh +++ b/copy_files.sh @@ -8,6 +8,20 @@ FTP_PATH=$FTP_PATH # mount -t nfs $NFS_SERVER:$NFS_PATH /mnt/nfs +echo "Start copying via FTP $FTP_PATH" sftp -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no $FTP_USER@$FTP_SERVER:$FTP_PATH /mnt/beacon_data +cd /mnt/beacon_data -umount /mnt/beacon_data +echo "Unpacking the data" +tar -I zstd -xvf *.tar.zst + +echo "Deleting the tar.zst" +rm *.tar.zst + + +if [ -n "$DEBUG" ]; then + echo "In debug mode, you need to kill manually the container" + tail -f /dev/null +fi + +# umount /mnt/beacon_data