2024-07-03 11:34:04 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
FTP_SERVER=$FTP_SERVER
|
|
|
|
FTP_USER=$FTP_USER
|
|
|
|
FTP_PATH=$FTP_PATH
|
|
|
|
#NFS_SERVER=$NFS_SERVER
|
|
|
|
#NFS_PATH=$NFS_PATH
|
|
|
|
|
|
|
|
# mount -t nfs $NFS_SERVER:$NFS_PATH /mnt/nfs
|
|
|
|
|
2024-07-11 10:45:35 +02:00
|
|
|
echo "Start copying via FTP $FTP_PATH"
|
2024-07-03 11:34:04 +02:00
|
|
|
sftp -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no $FTP_USER@$FTP_SERVER:$FTP_PATH /mnt/beacon_data
|
2024-07-11 10:45:35 +02:00
|
|
|
cd /mnt/beacon_data
|
2024-07-03 11:34:04 +02:00
|
|
|
|
2024-07-11 10:45:35 +02:00
|
|
|
echo "Unpacking the data"
|
|
|
|
tar -I zstd -xvf *.tar.zst
|
|
|
|
|
2024-07-16 10:47:59 +02:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "Deleting the tar.zst"
|
|
|
|
rm *.tar.zst
|
|
|
|
else
|
|
|
|
echo "Tar command failed. Not deleting the tar.zst file."
|
|
|
|
fi
|
2024-07-11 10:45:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$DEBUG" ]; then
|
|
|
|
echo "In debug mode, you need to kill manually the container"
|
|
|
|
tail -f /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
# umount /mnt/beacon_data
|