Skip to content

Commit

Permalink
Updated collect-logs-sftp.sh.txt to skip tedious StrictHostKeyChecking
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ccharlton authored Oct 16, 2023
1 parent 15be193 commit 363d8d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/scripts/collect-logs-sftp.sh.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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..'
Expand Down Expand Up @@ -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
fi

0 comments on commit 363d8d8

Please sign in to comment.