File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ===
109DEST_DIR=" $HOME /work/data"
11- DEST_FILE=" $DEST_DIR /$( basename " $BUCKET_PATH " ) "
12-
13- # === Ensure destination folder exists ===
10+ # Ensure destination folder exists
1411mkdir -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 ===
2119if [ $? -eq 0 ]; then
2220 echo " ✅ File downloaded successfully to $DEST_FILE "
2321else
24- echo " ❌ Failed to download file from $BUCKET_PATH "
22+ echo " ❌ Failed to download file from $DATA_PATH "
2523 exit 1
2624fi
25+
26+ # === Download a second file ===
27+ # Repeat the code above for each file
28+
You can’t perform that action at this time.
0 commit comments