Hi all,
I am trying to run few commands and save output of those commands into a single file for checking later.
So far, I have come up with the following playbook:
Hi all,
I am trying to run few commands and save output of those commands into a single file for checking later.
So far, I have come up with the following playbook:
`
`
Since you are saving to a file, maybe just save the output directly.
`
date +"%Y-%m-%d %T"
infodate +"%Y-%m-%d %T"
info`
`
shell: echo date +"%Y-%m-%d %T"
info
2018-07-20 21:48:45 info
shell: ls wrong
ls: cannot access ‘wrong’: No such file or directory
shell: echo date +"%Y-%m-%d %T"
info
2018-07-20 21:48:45 info
shell: echo test
test
`
Alternatively you can actually do an inline Jina loop. e.g.
Hi Marcin,
Your solution works perfectly. I modified it a bit to suit my needs. So thank you very much.
Hi Ed,
I tried your solution but it is giving me a syntax error that I am not sure how to approach:
From your mail:
content: | …
dest=/root/info.txt
And from the mail you quoted:
content: | …
dest: /root/info.txt
-- Abhijit
Oh wow,
/me hides face.
Thank you