Created
January 7, 2025 16:20
-
-
Save haxwithaxe/2f2b8a07ad686fb62aec2394159f943b to your computer and use it in GitHub Desktop.
Long term antenna test data logger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script downloads an activity log from PSKReporter and some space weather | |
# stats. | |
# Create the log directory, make the script executable, and add the following | |
# to your crontab: | |
# | |
# @daily <Path to the script>/pskreporter-logger.sh daily | |
# 0 6 * * * <Path to the script>/pskreporter-logger.sh past_UTC_0000 | |
# | |
# Replace `6` with the hour of the day for UTC 00:00 for your | |
# timezone outside of DST so that the space weather gets downloaded for the | |
# current day. It's just to reduce confusion during data processing. | |
LOG_DIR="$HOME/pskreporter-log" | |
CALLSIGN=<YOUR CALL HERE> | |
daily() { | |
wget -q "https://pskreporter.info/cgi-bin/pskdata.pl?adif=1&days=1&senderCallsign=$CALLSIGN" -O "$LOG_DIR/from_$CALLSIGN-$(date +%Y-%m-%d_%H%M%Z).adif" | |
wget -q "https://pskreporter.info/cgi-bin/pskdata.pl?adif=1&days=1&receiverCallsign=$CALLSIGN" -O "$LOG_DIR/to_$CALLSIGN-$(date +%Y-%m-%d_%H%M%Z).adif" | |
} | |
past_UTC_0000() { | |
wget -q "https://services.swpc.noaa.gov/text/sgarf.txt" -O "$LOG_DIR/noaa-sgarf-$(date +%Y-%m-%d_%H%M%Z).txt" | |
} | |
case $1 in | |
daily) | |
daily >/dev/null | |
;; | |
past_UTC_0000) | |
past_UTC_0000 >/dev/null | |
;; | |
*) | |
echo Invalid argument | |
echo "$0 <daily|past_UTC_0000>" | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment