From 94fe2be44f185e8e35ba4e3ff19c181434b1d175 Mon Sep 17 00:00:00 2001 From: sudo-shashank Date: Wed, 8 May 2024 11:17:32 +0530 Subject: [PATCH] fix new snapshot path extraction --- ansible/archival-snapshots/resources/main.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ansible/archival-snapshots/resources/main.sh b/ansible/archival-snapshots/resources/main.sh index 04a1dfb36..47d278068 100755 --- a/ansible/archival-snapshots/resources/main.sh +++ b/ansible/archival-snapshots/resources/main.sh @@ -28,7 +28,8 @@ while ((LATEST_EPOCH - CURRENT_EPOCH > 30000)); do # Export full snapshot to generate lite and diff snapshots $FOREST_CLI snapshot export --tipset "$NEW_EPOCH" --depth 30000 > export.log - NEW_SNAPSHOT=$(grep forest export.log | awk -F'[:]' '{print $1}') + NEW_SNAPSHOT=$(grep -a forest export.log | awk -F'[:]' '{print $1}' | tail -1) + echo "New Snapshot Downloaded: $NEW_SNAPSHOT" # Generate and upload lite snapshot if [ ! -f "$LITE_SNAPSHOT_DIR/$NEW_SNAPSHOT" ]; then