batch/insee.sh

22 lines
728 B
Bash
Raw Normal View History

2015-11-24 15:25:53 +00:00
#!/bin/bash
2015-11-27 16:16:01 +00:00
# --- Configuration
2015-11-24 15:25:53 +00:00
BASEPATH="/home/scores/batch"
2016-01-26 13:55:08 +00:00
STORAGE="/home/scores/batch/shared/sources/insee/send"
2015-11-27 16:16:01 +00:00
#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"
2015-11-24 15:25:53 +00:00
2015-11-27 16:16:01 +00:00
# --- Execution en cours
2015-11-24 15:25:53 +00:00
# --- Execution de la récupération des fichiers
curl -s ${OPTION} ${URL} | grep -e '^-' | awk '{ print $9 }' | while read f; do
2015-11-27 16:16:01 +00:00
if [ ! -e ${STORAGE}/${f} ]; then
cd ${STORAGE}
echo ${URL}$f;
curl -s -S ${OPTION} -O ${URL}$f
2015-11-24 15:25:53 +00:00
fi
2015-11-27 16:16:01 +00:00
done
# --- Suppression fichier lock