From 7e01e88b9d09ff6939cff7d07c31e66b386bab17 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Fri, 22 Sep 2023 14:56:19 +0100 Subject: [PATCH] Log to a file --- c66.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/c66.bash b/c66.bash index fd40326..2c2f5ca 100755 --- a/c66.bash +++ b/c66.bash @@ -27,10 +27,15 @@ cx_ssh() { cx_log() { set_stack + OUTPUT_FILE=$(mktemp) + echo "Logging to $OUTPUT_FILE" SERVERS=$(cx servers list --stack $APPLICATION --environment $ENVIRONMENT | grep "\[.*$ROLE.*\]" | cut -d ' ' -f1) for SERVER in ${SERVERS// /} ; do - cx tail --stack $APPLICATION --environment $ENVIRONMENT $SERVER $LOG_FILE & + echo "Following $LOG_FILE on $SERVER" + cx tail --stack $APPLICATION --environment $ENVIRONMENT $SERVER $LOG_FILE > ./$SERVER.log & done + #tail -f $OUTPUT_FILE + #pkill cx } ############################################################