# Recovering stdout and stderr from sudo commands in async mode

**URL:** <https://forum.ansible.com/t/recovering-stdout-and-stderr-from-sudo-commands-in-async-mode/19746>\
**Category:** Ansible Project\
**Created:** [November 12, 2015, 2:02pm UTC](https://forum.ansible.com/t/recovering-stdout-and-stderr-from-sudo-commands-in-async-mode/19746 "2015-11-12T14:02:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Angel\_De\_Bustos](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@Jose\_Angel\_De\_Bustos](https://forum.ansible.com/u/Jose_Angel_De_Bustos)\
**Post date:** [November 12, 2015, 2:02pm UTC](https://forum.ansible.com/t/recovering-stdout-and-stderr-from-sudo-commands-in-async-mode/19746/1 "2015-11-12T14:02:34Z")

</div>

Hi,

I have to run sudo commands in async mode and recover the stdout/stderr.

I have written a module to run sudo commands but I am not able to recover the stdout and stderr. All of this is done from a python script and in the json which is returned the file indicated in results\_file is empty.

Any ideas/suggestions?

I am new to ansible so maybe there is a better way to do that.

Best regards,
