Skip to content

added the updated bash script - #36

Open
mjami00 wants to merge 3 commits into
mainfrom
bash
Open

mjami00 wants to merge 3 commits into
mainfrom
bash

Conversation

@mjami00

@mjami00 mjami00 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

This script is updated by Junchang

mjami00 added 3 commits April 22, 2026 13:34
…_dir>) to retry only failed downloads without re-querying CMR; exits cleanly if the file is missing or empty

Pagination: Replaced single page_size=2000 query with a paginated loop, so searches returning more than 2000 granules are handled correctly
CMR query timeouts: Added 60s timeout on CMR queries to prevent the script from hanging when CMR is slow or unresponsive
CMR loop guard: Added a validity check on each CMR response — breaks the pagination loop on invalid or empty responses instead of looping forever
Date order validation: Added check that start date is not after end date; exits with a clear error message
Per-file retry logic: Each file is retried up to 3 times before being marked as failed, instead of failing the entire granule on first error
Downloads: Files are downloaded to a temp path and renamed to the final name only on success, preventing partial files from appearing complete
Partial granule preservation: On failure, successfully downloaded files are kept and only the failed URLs are written to failed_downloads.txt; the entire granule directory is no longer deleted
curl compatibility fix: Replaced attribute[]= query syntax with attribute=, which caused curl to return exit code 3 on some systems (e.g., CentOS)
Cloud coverage filter: Fixed cloud coverage filter — changed type from float to int and applied it correctly (was commented out / broken in upstream)
Improved messaging: Distinct end-of-run messages for: 0 granules found (with CMR status note), successful run, successful re-run, and partial failures with re-run instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant