forked from colin/disk-space-report
Update pull-logs.sh
This commit is contained in:
parent
188ace0943
commit
1d41668fc8
16
pull-logs.sh
16
pull-logs.sh
|
@ -1,20 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Check if correct number of arguments are passed
|
# Check if correct number of arguments are passed
|
||||||
if [ "$#" -ne 3 ]; then
|
if [ "$#" -ne 2 ]; then
|
||||||
echo "Usage: $0 <target-date> <target-time> <time-range>"
|
echo "Usage: $0 <start-time> <end-time>"
|
||||||
echo "Example: $0 2024-09-28 11:35 5"
|
echo "Example: $0 '2024-09-28 11:30:00' '2024-09-28 11:40:00'"
|
||||||
echo "The time range is in minutes."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TARGET_DATE=$1
|
START=$1
|
||||||
TARGET_TIME=$2
|
END=$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")
|
|
||||||
|
|
||||||
# Debugging output to ensure correct start and end times
|
# Debugging output to ensure correct start and end times
|
||||||
echo "START: $START"
|
echo "START: $START"
|
||||||
|
|
Loading…
Reference in New Issue