rem Variables locales
set FICHIER_CONF="%1"
set FICHIER_LOG="%2"
set DOSSIER_LOCAL_EXPORTS="%3"
set DOSSIER_LOCAL_IMPORTS="%4"
set DOSSIER_DISTANT_EXPORTS=%5
set DOSSIER_DISTANT_IMPORTS=%6
set TXT_PWD="%7"

rclone.exe      --config %FICHIER_CONF% config update TRANSFERT2FTP pass %TXT_PWD% -v --log-file=%FICHIER_LOG%

rem /delete des .partial*/
rclone.exe delete   --config %FICHIER_CONF% TRANSFERT2FTP:%DOSSIER_DISTANT_EXPORTS% --ignore-case --include *.{partial} --progress --min-age=3h --log-file %FICHIER_LOG% -v

rem /*uploads*/
rclone.exe move --config %FICHIER_CONF% %DOSSIER_LOCAL_EXPORTS% TRANSFERT2FTP:%DOSSIER_DISTANT_EXPORTS% --ignore-case --include *.{csv,pdf,zip,xml,tra} --progress --log-file %FICHIER_LOG% -v 

echo . >> %FICHIER_LOG%

rem /*lists remote*/
rem rclone.exe ls   --config %FICHIER_CONF% TRANSFERT2FTP:%DOSSIER_DISTANT_EXPORTS%   --progress --log-file %FICHIER_LOG% -v
echo "ls : %DOSSIER_DISTANT_EXPORTS%" >> %FICHIER_LOG%
rclone.exe ls   --config %FICHIER_CONF% TRANSFERT2FTP:%DOSSIER_DISTANT_EXPORTS%   --progress -v >> %FICHIER_LOG%
echo . >> %FICHIER_LOG%
echo "ls : %DOSSIER_DISTANT_IMPORTS%" >> %FICHIER_LOG%
rclone.exe ls   --config %FICHIER_CONF% TRANSFERT2FTP:%DOSSIER_DISTANT_IMPORTS%   --progress -v >> %FICHIER_LOG%
echo . >> %FICHIER_LOG%

rem /*downloads*/
rclone.exe move --config %FICHIER_CONF% TRANSFERT2FTP:%DOSSIER_DISTANT_IMPORTS% %DOSSIER_LOCAL_IMPORTS% --ignore-case --include *.{csv,pdf,zip,xml,tra} --progress --log-file %FICHIER_LOG% -v
