From 363d8d8a1661f5c77721ca09a82136c593156b3d Mon Sep 17 00:00:00 2001 From: Chris Charlton Date: Mon, 16 Oct 2023 15:29:10 -0700 Subject: [PATCH] Updated collect-logs-sftp.sh.txt to skip tedious StrictHostKeyChecking Added a useful parameter in the SFTP command that skips the need to ask the user if it's okay to connect with each appserver before downloading the logs. It's pretty tedious for the user without this flag, especially on site plans with many appservers. --- source/scripts/collect-logs-sftp.sh.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/scripts/collect-logs-sftp.sh.txt b/source/scripts/collect-logs-sftp.sh.txt index faa624d367..0c6f1563bb 100644 --- a/source/scripts/collect-logs-sftp.sh.txt +++ b/source/scripts/collect-logs-sftp.sh.txt @@ -18,13 +18,13 @@ if [ $COLLECT_LOGS == true ]; then echo 'COLLECT_LOGS set to $COLLECT_LOGS. Beginning the process...' for app_server in $(dig +short -4 appserver.$ENV.$SITE_UUID.drush.in); do - echo "get -R logs \"app_server_$app_server\"" | sftp -o Port=2222 "$ENV.$SITE_UUID@$app_server" + echo "get -R logs \"app_server_$app_server\"" | sftp -o StrictHostKeyChecking=no -o Port=2222 "$ENV.$SITE_UUID@$app_server" done # Include MySQL logs for db_server in $(dig +short -4 dbserver.$ENV.$SITE_UUID.drush.in); do - echo "get -R logs \"db_server_$db_server\"" | sftp -o Port=2222 "$ENV.$SITE_UUID@$db_server" + echo "get -R logs \"db_server_$db_server\"" | sftp -o StrictHostKeyChecking=no -o Port=2222 "$ENV.$SITE_UUID@$db_server" done else echo 'skipping the collection of logs..' @@ -65,4 +65,4 @@ fi if [ $CLEANUP_AGGREGATE_DIR == true ]; then echo 'CLEANUP_AGGREGATE_DIR set to $CLEANUP_AGGREGATE_DIR. Cleaning up the aggregate-logs directory' find ./aggregate-logs/ -name 'nginx-access*' -print -exec rm {} \; -fi \ No newline at end of file +fi