From ffc8ae54b7d1688babbc972694a9d5fccf76c93a Mon Sep 17 00:00:00 2001 From: Liu Haoyu Date: Tue, 7 Feb 2023 09:50:45 +0800 Subject: [PATCH] bucket_name指定错误修复, 监听事件减少 --- docker-entrypoint.sh | 4 ++-- mc_watcher.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c9bea48..120d64b 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -2,7 +2,7 @@ # mc alias set mc alias set local ${minio_endpoint} ${minio_access_key} ${minio_secret_key} -nohup mc mirror -w /data/ local/${bucket_name}/ & +nohup mc mirror -w /data/ local/${bucket_name} & # mc watcher -mc_watcher.sh \ No newline at end of file +mc_watcher.sh diff --git a/mc_watcher.sh b/mc_watcher.sh index ef0afc0..d984f60 100644 --- a/mc_watcher.sh +++ b/mc_watcher.sh @@ -2,8 +2,8 @@ TARGET_DIR="/data/" -mc watch --recursive local/togoftp | while read events; +mc watch --recursive ${TARGET_DIR} --events put | while read events; do - hostUrl=${events#*//} - echo "${hostUrl#*/}" > /dev/udp/${udp_server_ip}/${udp_server_port} -done \ No newline at end of file + hostUrl=${events#*/data} + echo "${bucket_name}${hostUrl}" > /dev/udp/${udp_server_ip}/${udp_server_port} +done -- libgit2 0.21.4