Skip to content

Commit d2a250b

Browse files
authored
Updated collect-logs-sftp.sh.txt to skip tedious StrictHostKeyChecking (#8747)
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.
1 parent 0b6dd59 commit d2a250b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/scripts/collect-logs-sftp.sh.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ if [ $COLLECT_LOGS == true ]; then
1818
echo 'COLLECT_LOGS set to $COLLECT_LOGS. Beginning the process...'
1919
for app_server in $(dig +short -4 appserver.$ENV.$SITE_UUID.drush.in);
2020
do
21-
echo "get -R logs \"app_server_$app_server\"" | sftp -o Port=2222 "$ENV.$SITE_UUID@$app_server"
21+
echo "get -R logs \"app_server_$app_server\"" | sftp -o StrictHostKeyChecking=no -o Port=2222 "$ENV.$SITE_UUID@$app_server"
2222
done
2323

2424
# Include MySQL logs
2525
for db_server in $(dig +short -4 dbserver.$ENV.$SITE_UUID.drush.in);
2626
do
27-
echo "get -R logs \"db_server_$db_server\"" | sftp -o Port=2222 "$ENV.$SITE_UUID@$db_server"
27+
echo "get -R logs \"db_server_$db_server\"" | sftp -o StrictHostKeyChecking=no -o Port=2222 "$ENV.$SITE_UUID@$db_server"
2828
done
2929
else
3030
echo 'skipping the collection of logs..'
@@ -65,4 +65,4 @@ fi
6565
if [ $CLEANUP_AGGREGATE_DIR == true ]; then
6666
echo 'CLEANUP_AGGREGATE_DIR set to $CLEANUP_AGGREGATE_DIR. Cleaning up the aggregate-logs directory'
6767
find ./aggregate-logs/ -name 'nginx-access*' -print -exec rm {} \;
68-
fi
68+
fi

0 commit comments

Comments
 (0)