#!/bin/bash BASEPATH="/home/scores/batch" STORAGE="/home/data/sources/insee/ftps/" 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 de la récupération des fichiers curl -s ${OPTION} ${URL} | grep -e '^-' | awk '{ print $9 }' | while read f; do cd ${STORAGE} if [[ ! -e $f || -s $f ]]; then echo ${URL}$f; # curl ${OPTION} -O ${URL}$f fi done