I am trying to run multiple commands in a K8s cron job. However, only the first jobs output is showing in the logs. I have this:
containers:
- name: myjob
image: postgres
args:
- /bin/sh
- -c
- PGPASSWORD=$(echo $password) psql -h $host -p 5432 -U $username -d $db -c "\copy (select * from blah limit 1) to blah.txt" ; echo bar.txt ; cat bar.txt;
- PGPASSWORD=$(echo $password) psql -h $host -p 5432 -U $username -d $db -c "\copy (select * from foo limit 1) to foo.txt" ; date ; echo foo.txt ; cat foo.txt;
restartPolicy: OnFailure
I am only seeing the output from the first command. I would like to be able to specify multiple commands and run them one by one.