Skip to content

Commit

Permalink
sync script
Browse files Browse the repository at this point in the history
  • Loading branch information
floriscalkoen committed Feb 20, 2024
1 parent f34b31d commit f7d1098
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions scripts/bash/sync-overture-to-local.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
#!/bin/bash
mkdir -p ~/data/overture-02-15
cd ~/data/overture-02-15
aws s3 sync --no-sign-request s3://overturemaps-us-west-2/release/2024-02-15-alpha.0/ .

DEFAULT_RELEASE="2024-02-15-alpha.0"
DEFAULT_DESTINATION="$HOME/data/src/overture/$DEFAULT_RELEASE"

while getopts ":d:r:" opt; do
case ${opt} in
d) # Process option for the destination
DESTINATION=$OPTARG
;;
r) # Process option for the release
RELEASE=$OPTARG
;;
\?)
echo "Usage: cmd [-d destination] [-r release]"
;;
esac
done

# Set the destination directory based on the provided destination or release argument
DESTINATION="${DESTINATION:-$DEFAULT_DESTINATION}"
RELEASE="${RELEASE:-$DEFAULT_RELEASE}"

mkdir -p "${DESTINATION}"
cd "${DESTINATION}"

aws s3 sync --no-sign-request "s3://overturemaps-us-west-2/release/${RELEASE}/" .

# Verification step to ensure all files are transferred correctly
# This is a simple re-sync operation; any missing or incomplete files will be re-downloaded
echo "Verifying file transfer..."
aws s3 sync --no-sign-request "s3://overturemaps-us-west-2/release/${RELEASE}/" . --dryrun

0 comments on commit f7d1098

Please sign in to comment.