There's a few reasons for these changes being required.
The portal_query function as it was written would never have pulled in arguments form elsewhere.
The portal_query function, even if arguments are passed in, would never receive single-quote items (such as used with -c 'SELECT ... as it was in the cronrun-day script). Bash string handling happens before it gets ingested into arguments, which makes the use of this as a function irrelevant.
Changing portal_query to a variable with the query string stored in it, and then calling it as a variable elsewhere, solves the issue of the queries hanging or failing.
Without such changes, the daily run cron script will fail to finish executing and fail to do what it is supposed to do.
There's a few reasons for these changes being required.
-c 'SELECT ...
as it was in thecronrun-day
script). Bash string handling happens before it gets ingested into arguments, which makes the use of this as a function irrelevant.portal_query
to a variable with the query string stored in it, and then calling it as a variable elsewhere, solves the issue of the queries hanging or failing.Without such changes, the daily run cron script will fail to finish executing and fail to do what it is supposed to do.