SmartCane/update_RDS.sh
guillaume91 3f7043199b okay
2024-06-26 13:00:22 +02:00

39 lines
854 B
Bash
Executable file

#!/bin/bash
end_date=$(date +'%Y-%m-%d')
offset=7
project_dir="chemba"
# 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=7 --project_dir=chemba"
exit 1
fi
echo ci_extraction.R $end_date $offset $project_dir
cd ../r_app
Rscript ci_extraction.R $end_date $offset $project_dir