Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
update: Check all years instead of just current year
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
iakat committed Feb 14, 2024
1 parent e10ee1a commit a876d23
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion manifests/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fi
for POD in $PODS; do
echo "[ info] Processing pod $POD"
YEAR=$(date +%Y)
FOLDERS=$(kubectl -n adsblol exec -ti $POD -- find /var/globe_history/$YEAR -maxdepth 2 || true)
FOLDERS=$(kubectl -n adsblol exec -ti $POD -- find /var/globe_history/ -maxdepth 3 || true)
IFS=$'\n\r'
for FOLDER in $FOLDERS; do
IFS=$SAVEIFS
Expand Down Expand Up @@ -123,6 +123,14 @@ for POD in $PODS; do
echo "[ info] $RELEASE_NAME has already been backed up. Skipping."
continue
fi
# Try seeing if file exists,
# https://github.com/adsblol/globe_history_2024/releases/download/v2024.01.19-planes-readsb-staging-0/v2024.01.19-planes-readsb-staging-0.tar
# If it exists, we skip
FILE_URL="https://github.com/adsblol/globe_history_$CURRENT_YEAR/releases/download/$RELEASE_NAME/$RELEASE_NAME.tar"
if curl -s --head $FILE_URL | head -n 1 | grep "HTTP/[123][.1]* [23].." > /dev/null; then
echo "[ info] $FILE_URL has already been backed up. Skipping."
continue
fi
# Otherwise let's get to work
echo "[ info] Backing up $RELEASE_NAME"
# 5.1. MKTEMP a folder
Expand Down

0 comments on commit a876d23

Please sign in to comment.