From 1d41668fc8b333ac18d66ec5523549bf8ec1da42 Mon Sep 17 00:00:00 2001 From: colin Date: Sat, 28 Sep 2024 12:22:10 -0400 Subject: [PATCH] Update pull-logs.sh --- pull-logs.sh | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pull-logs.sh b/pull-logs.sh index 881183b..e788a5e 100644 --- a/pull-logs.sh +++ b/pull-logs.sh @@ -1,20 +1,14 @@ #!/bin/bash # Check if correct number of arguments are passed -if [ "$#" -ne 3 ]; then - echo "Usage: $0 " - echo "Example: $0 2024-09-28 11:35 5" - echo "The time range is in minutes." +if [ "$#" -ne 2 ]; then + echo "Usage: $0 " + echo "Example: $0 '2024-09-28 11:30:00' '2024-09-28 11:40:00'" exit 1 fi -TARGET_DATE=$1 -TARGET_TIME=$2 -RANGE=$3 - -# Combine date and time for start and end times in ISO 8601 format -START=$(date -d "$TARGET_DATE $TARGET_TIME - $RANGE minutes" +"%Y-%m-%d %H:%M:%S") -END=$(date -d "$TARGET_DATE $TARGET_TIME + $RANGE minutes" +"%Y-%m-%d %H:%M:%S") +START=$1 +END=$2 # Debugging output to ensure correct start and end times echo "START: $START"