Gestion de l'authentification rclone à travers des variables

This commit is contained in:
nono 2024-02-28 07:40:50 +00:00
parent b6d7ef3788
commit 69770db65e

View file

@ -34,13 +34,34 @@
# ENABLE_BACKUP_REPLICATION=0 : disable replication # ENABLE_BACKUP_REPLICATION=0 : disable replication
# ENABLE_BACKUP_REPLICATION=1 : enable replication # ENABLE_BACKUP_REPLICATION=1 : enable replication
export ENABLE_BACKUP_REPLICATION=0 export ENABLE_BACKUP_REPLICATION=0
export BCK_REPLICATE_TMP_DIR=/opt/backup/tmp
export BCK_REPLICATION_OS_REGION_NAME=${OS_REGION_NAME} export BCK_REPLICATION_OS_REGION_NAME=${OS_REGION_NAME}
export BCK_REPLICATION_OS_APPLICATION_CREDENTIAL_ID=${OS_APPLICATION_CREDENTIAL_ID} export BCK_REPLICATION_OS_APPLICATION_CREDENTIAL_ID=${OS_APPLICATION_CREDENTIAL_ID}
export BCK_REPLICATION_OS_APPLICATION_CREDENTIAL_SECRET=${OS_APPLICATION_CREDENTIAL_SECRET} export BCK_REPLICATION_OS_APPLICATION_CREDENTIAL_SECRET=${OS_APPLICATION_CREDENTIAL_SECRET}
export BCK_REPLICATION_PROJECT_ID=${PROJECT_ID} export BCK_REPLICATION_PROJECT_ID=${PROJECT_ID}
export BCK_RCLONE_SRC_ALIAS=""
export BCK_RCLONE_DST_ALIAS="" export RCLONE_CONFIG_BCKDST_TYPE=swift
export BCK_REPLICATE_TMP_DIR=/opt/backup/tmp export RCLONE_CONFIG_BCKDST_AUTH_VERSION=3
export RCLONE_CONFIG_BCKDST_AUTH=https://auth.cloud.ovh.net/v3
export RCLONE_CONFIG_BCKDST_ENDPOINT_TYPE=public
export RCLONE_CONFIG_BCKDST_TENANT_DOMAIN=default
export RCLONE_CONFIG_BCKDST_DOMAIN=default
export RCLONE_CONFIG_BCKDST_TENANT=
export RCLONE_CONFIG_BCKDST_USER=
export RCLONE_CONFIG_BCKDST_KEY=
export RCLONE_CONFIG_BCKDST_REGION=
export RCLONE_CONFIG_BCKSRC_TYPE=swift
export RCLONE_CONFIG_BCKSRC_AUTH_VERSION=3
export RCLONE_CONFIG_BCKSRC_AUTH=https://auth.cloud.ovh.net/v3
export RCLONE_CONFIG_BCKSRC_ENDPOINT_TYPE=public
export RCLONE_CONFIG_BCKSRC_TENANT_DOMAIN=default
export RCLONE_CONFIG_BCKSRC_DOMAIN=default
export RCLONE_CONFIG_BCKSRC_TENANT=
export RCLONE_CONFIG_BCKSRC_USER=
export RCLONE_CONFIG_BCKSRC_KEY=
export RCLONE_CONFIG_BCKSRC_REGION=
# Number of backup instances to keep # Number of backup instances to keep
export MAX_KEEP_BACKUP_INSTANCES=100 export MAX_KEEP_BACKUP_INSTANCES=100
@ -245,7 +266,7 @@ function replicate_backup(){
_info " => Starting Backup Volume Replication" _info " => Starting Backup Volume Replication"
_info_action " Syncing S3 volumebackups" _info_action " Syncing S3 volumebackups"
${RCLONE} sync --fast-list --transfers=30 --checkers=12 ${BCK_RCLONE_SRC_ALIAS}:volumebackups/ ${BCK_RCLONE_DST_ALIAS}:volumebackups/ ${RCLONE} sync --fast-list --transfers=30 --checkers=12 BCKSRC:volumebackups/ BCKDST:volumebackups/
for BCK_VOLUME in "${BCK_VOLUMES_LIST[@]}" for BCK_VOLUME in "${BCK_VOLUMES_LIST[@]}"
do do