39 lines
853 B
Bash
Executable file
39 lines
853 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: build_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 |