batch/insee.sh
2016-01-26 13:55:08 +00:00

22 lines
728 B
Bash

#!/bin/bash
# --- Configuration
BASEPATH="/home/scores/batch"
STORAGE="/home/scores/batch/shared/sources/insee/send"
#URL="ftp://192.168.3.202/"
#OPTION="--user mpc2500:passmpc78"
URL="ftp://81.255.68.110:21/download/"
OPTION="-k --ssl --disable-epsv --user client_syracuse23:cLiEnT_SYRAcuse23*37654 --cacert ${BASEPATH}/certs/ca.pem --cert ${BASEPATH}/certs/client.pem --key ${BASEPATH}/certs/key.pem"
# --- Execution en cours
# --- Execution de la récupération des fichiers
curl -s ${OPTION} ${URL} | grep -e '^-' | awk '{ print $9 }' | while read f; do
if [ ! -e ${STORAGE}/${f} ]; then
cd ${STORAGE}
echo ${URL}$f;
curl -s -S ${OPTION} -O ${URL}$f
fi
done
# --- Suppression fichier lock