Skip to content

Commit 464f4d6

Browse files
committed
Improve an init script
1 parent f1a1e0d commit 464f4d6

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

sspcloud/download_data.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@ echo "Executing the download_data.sh script"
55
# This script downloads a data file from an S3 bucket using `mc` (MinIO client)
66
# and stores it in the ~/work/data directory.
77

8-
# === Config ===
9-
BUCKET_PATH="s3/donnees-insee/diffusion/ETAT_CIVIL/2020/DECES_COM_1019.csv"
8+
# === Config destination folder ===
109
DEST_DIR="$HOME/work/data"
11-
DEST_FILE="$DEST_DIR/$(basename "$BUCKET_PATH")"
12-
13-
# === Ensure destination folder exists ===
10+
# Ensure destination folder exists
1411
mkdir -p "$DEST_DIR"
1512

16-
# === Download the file ===
17-
echo "Downloading $BUCKET_PATH to $DEST_FILE..."
18-
mc cp "$BUCKET_PATH" "$DEST_DIR"
13+
# === Download a first file ===
14+
DATA_PATH="s3/donnees-insee/diffusion/ETAT_CIVIL/2020/DECES_COM_1019.csv"
15+
echo "Downloading $DATA_PATH to $DEST_FILE..."
16+
mc cp "$DATA_PATH" "$DEST_DIR"
1917

2018
# === Check success ===
2119
if [ $? -eq 0 ]; then
2220
echo "✅ File downloaded successfully to $DEST_FILE"
2321
else
24-
echo "❌ Failed to download file from $BUCKET_PATH"
22+
echo "❌ Failed to download file from $DATA_PATH"
2523
exit 1
2624
fi
25+
26+
# === Download a second file ===
27+
# Repeat the code above for each file
28+

0 commit comments

Comments
 (0)