#!/bin/bash

HC_ID=cb6075c7-1680-43eb-9a6e-2b2f635202d7
RCLONE_CONFIG_FILE=/opt/rclone/rclone.conf
ROOT_SRC_DIR="/srv/smb/beltex/Luca"
ROOT_DST_DIR="o365_beltex:/Luca-Gestcom"

curl -m 10 --retry 5 https://hc.noxs.me/ping/"$HC_ID"/start

DIR_LIST="_Documents_PDF _Prix_clients _Prix_clients_Archives"

for DIR in $DIR_LIST
do
    rclone copy --config "$RCLONE_CONFIG_FILE" \
        --ignore-size \
        --ignore-checksum \
        -vvv \
        --log-file /var/log/beltex"$DIR".log \
        "$ROOT_SRC_DIR/$DIR/"  "$ROOT_DST_DIR/$DIR/"
done  


curl -m 10 --retry 5 https://hc.noxs.me/ping/"$HC_ID"

