Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"source" command not working in "cronitor exec" #25

Open
AshleyJackson opened this issue Oct 7, 2024 · 0 comments
Open

"source" command not working in "cronitor exec" #25

AshleyJackson opened this issue Oct 7, 2024 · 0 comments

Comments

@AshleyJackson
Copy link

AshleyJackson commented Oct 7, 2024

There is an issue with the CLI where the below examples fail to source any data from other shell scripts. If I run the source command to the shell scripts manually in terminal, it works without any issues. I've tried to around this issue with escaping characters here and there and nothing comes up.

Cronfile.cron

TESTRC="/clients/client1/scheme/config/exports.sh"
*/3 * * * * client1 cronitor exec qa***" source \"$TESTRC\" && $TEST_APP_PATH/bin/TEST_process_email_queue.php $TEST_CONFIG 50"

exports.sh

CLIENT="client1"
source "/clients/${CLIENT}/program/bin/commonrc"
export TZ="Europe/London"

/clients/${CLIENT}/program/bin/commonrc

TEST_PROG_PATH="/clients/${CLIENT}"
TEST_APP_PATH="${TEST_PROG_PATH}/program"
TEST_CONFIG="${TEST_PROG_PATH}/scheme/config/central.conf"

Terminal - Echo Client

~ # cronitor -v -l test.log exec qa*** "source \"$TESTRC\" && echo $CLIENT"
Reading config from /etc/cronitor/cronitor.json
Running subcommand: source "/clients/client/scheme/config/exports.sh" && echo
Sending ping https://cronitor.link/ping/a30433eb4**********************/qa****?state=run&try=1&stamp=1728337790.035&msg=source+%22%2F*******%2F*****%2Fscheme%2Fconfig%2Fexports.sh%22+%26%26+echo&host=****************************&series=1728337790.035&env=Production

Terminal - Echo $TEST_APP_PATH

~ # cronitor -v -l test.log exec qa****"source \"$TESTRC\" && echo $TEST_APP_PATH"
Reading config from /etc/cronitor/cronitor.json
Running subcommand: source "/clients/client1/scheme/config/exports.sh" && echo
Sending ping https://cronitor.link/ping/a30433eb48*******************/qa******?state=run&try=1&stamp=1728337580.752&msg=source+%22%2F*************%2F*************%2Fscheme%2Fconfig%2Fexports.sh%22+%26%26+echo&host=******************&series=1728337580.752&env=Production

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant