Hi all! I have set up a bash scripts (example bel...
# troubleshooting
c
Hi all! I have set up a bash scripts (example below) that update the
start_date
&
end_date
for our Google Analytic extractors, and then proceeds to run the pipeline. I have tried to schedule the script using a cron job. However, despite the script running when I manually execute, the cron job shows a ran but my config settings remain the same and the pipeline did not run! Any suggestions would be greatly appreciated!
a
Is this a local cron on the same machine as you've been using? Or remotely on a container? Focusing first on the settings not sticking, were you intending the settings update to be stored in the systemdb or in yaml? Also - in case there could be a problem with the cron execution, running you can add a statement like
touch $target_date.marker.txt
at the end of the script would simply create an empty file as proof that the code ran.
c
Thank you for the feedback @aaronsteers! This is currently on a Linux EC2. And and I believe these change should be reflected in the YAML.
So I do get a text file output, but still no run or dates updated in the YAML...
@aaronsteers Is it possible meltano commands would not execute from a cron job?
It appears as though I needed to set
PATH+
! Thank you for the help!
Copy code
PATH+=:/home/ubuntu/.local/bin

for i in {0..0}
do
	j=$(($i+1))
	target_date=$(date -d "-$i day" +'%Y-%m-%d')
	target_date_minus_one=$(date -d "-$j day" +'%Y-%m-%d')

	###  Landing Page Transaction ID to Source Medium
	meltano config ga-landing_page_transaction_id_to_source_medium set start_date "$target_date_minus_one"
	meltano config ga-landing_page_transaction_id_to_source_medium set end_date "$target_date"
	meltano elt ga-landing_page_transaction_id_to_source_medium Google-Analytics --job_id=landing-page-transaction-id-to-source-medium
done
a
Nice! Glad you got it working!