SmartCane/update_RDS.sh
2024-10-23 09:34:52 +02:00

39 lines
872 B
Bash
Executable file

#!/bin/bash
end_date=$(date +'%Y-%m-%d')
offset=28
project_dir="Bagamoyo_trial"
# Parse command line arguments
for arg in "$@"; do
case $arg in
--end_date=*)
end_date="${arg#*=}"
;;
--offset=*)
offset="${arg#*=}"
;;
--project_dir=*)
project_dir="${arg#*=}"
;;
*)
echo "Unknown option: $arg"
exit 1
;;
esac
shift
done
echo "end_date: $end_date"
echo "offset: $offset"
# Check if required arguments are set
if [ -z "$end_date" ] || [ -z "$project_dir" ] || [ -z "$offset" ]; then
echo "Missing arguments. Use: update_RDS.sh --end_date=2024-01-01 --offset=28 --project_dir=Bagamoyo_trial"
exit 1
fi
echo ci_extraction.R $end_date $offset $project_dir
cd ../r_app
Rscript ci_extraction.R $end_date $offset $project_dir