From b7e0d8197e59d8b9d4d78699d0fd582e1781a6e7 Mon Sep 17 00:00:00 2001 From: Perrine Letellier Date: Tue, 27 Aug 2024 18:33:57 +0200 Subject: [PATCH] change file rights for execution --- clevercloud/run_succeeded_hook.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 clevercloud/run_succeeded_hook.sh diff --git a/clevercloud/run_succeeded_hook.sh b/clevercloud/run_succeeded_hook.sh old mode 100644 new mode 100755 index 24ddb1e0..5550526b --- a/clevercloud/run_succeeded_hook.sh +++ b/clevercloud/run_succeeded_hook.sh @@ -1,14 +1,16 @@ -curl $S3CFG_FILE_URI > .s3cfg +#!/bin/bash +curl $S3CFG_FILE_URI > ~/.s3cfg # retrieve most recent date FILEPATH=$(s3cmd ls s3://csv-data| tail -1 | awk '{ print $2 }') DATE=${FILEPATH##"s3://csv-data/"} DATE=${DATE%"/"} +mkdir csv-data # if this date doesn't exist yet if ls csv-data/$DATE ; then echo "This data has already been loaded" else # retrieve most recent files - mkdir -p csv-data/$DATE/ + mkdir csv-data/$DATE/ s3cmd get s3://csv-data/$DATE/ --recursive csv-data/$DATE/ # import those files to database (django models) python $APP_ID/manage.py load_ingredients -d csv-data/$DATE $DATE