But same when we are trying to run in crontab. Its not working. We can see in cronlog that the cmd got run on scheduled time. but we can observed that its didnt get executed.
Further we tried to run the same in a bash script but the results are same.
We tried to source .bashrc file so that all the env variable should get imported but still the same.
Happy to see that you are using the production setup. Could you possibly give me more information related to this? Are you getting some sort of errors, or what is the response when you run the code?
Actually we are not getting any error at all. In above crontab entry, you can see we have redirected the output of that script to /tmp/somelogfile.txt but after running that script, nothing is getting updated in that file.
In cron logs, we can see that the script which we scheduled in crontab got triggered on mentioned time but it didnt get executed.
we tried to run the command from another server like trying to pass the command with ssh option like mentioned below . but it didnt get executed.
That also didnt work and from snaible logs we can see that the cmd got run but got exist very soon(please refer the start and end time in below logs) without printing any error.
Thank you for the additional information! I’ve now tested it myself and managed to make it work. This issue seems to occur when you pass the -jar file before the conf file and when the paths might be broken.
Could you possibly follow the structure below and try again?
For more reference, this is my code I’m running: * * * * * /usr/bin/java -Dconfig.file=/Users/rgu0221/Downloads/prod-setup/application.conf -jar /Users/rgu0221/Downloads/prod-setup/inquire-save-published-queries-6.1.1.jar
You can see whether the cronjob works by looking at the version number when you run the script manually: