0

I have a file .mqsc with a commands for create queues(ibm mq).
How to run a script by kubectl?
kubectl exec -n test -it mq-0 -- /bin/bash -f create_queues.mqsc doesn't work.
log:

/bin/bash: create_queues.mqsc: No such file or directory command terminated with exit code 127

AbrA
  • 434
  • 1
  • 6
  • 19
  • Does this help you? https://stackoverflow.com/questions/51247619/execute-bash-command-in-pod-with-kubectl – rock'n rolla Apr 02 '21 at 12:39
  • @rock'nrolla no – AbrA Apr 02 '21 at 12:52
  • Is `create_queues.mqsc` file at one of locations specified as `$PATH` ? – amitd Apr 02 '21 at 13:05
  • 1
    Can you check what your working directory is, e.g. with `kubectl directory exec -n test -it mq-0 -- pwd` and where is the file `create_queues.mqsc` ? – matt_j Apr 02 '21 at 14:46
  • Just specify the full path and filename. i.e. `/some/path/to/create_queues.mqsc` – Roger Apr 02 '21 at 17:13
  • 1
    MQSC commands need to be piped into the `runmqsc` command and unless you only have one queue manager in the container and it is set at the default you will also need to specify the queue manager name as on arg to `runmqsc` that you want the commands to apply to. – JoshMc Apr 03 '21 at 04:57

1 Answers1

1

Most probably your script is not under the "/" directory in docker. You need to find whole path after that you need to execute script

Kağan Mersin
  • 391
  • 2
  • 9