# raw module - run background tasks on remote machine (using nohup and &)

**URL:** <https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691>\
**Category:** Ansible Project\
**Created:** [September 30, 2016, 4:21pm UTC](https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691 "2016-09-30T16:21:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourav\_Chatterjee](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@Sourav\_Chatterjee](https://forum.ansible.com/u/Sourav_Chatterjee)\
**Post date:** [September 30, 2016, 4:21pm UTC](https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691/1 "2016-09-30T16:21:29Z")

</div>

I wanted to execute shell command on remote machine but in background using nohup and & like below -

- raw: “nohup touch /tmp/hello.txt &”

It is not working. It works if it is executed without nohup and &. Any suggestions would be helpful here.

Note: I will not be able to make use of any other module as python2 is not installed on remote machine and no internet connection on remote machine.

Thanks

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [September 30, 2016, 4:27pm UTC](https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691/2 "2016-09-30T16:27:48Z")

</div>

The & is a ‘shellism’, which raw module does not support, use ‘shell’ module instead, though i really recommend you set it up as a service instead.

---

<div class="post-metadata">

**Author:** ![Sourav\_Chatterjee](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@Sourav\_Chatterjee](https://forum.ansible.com/u/Sourav_Chatterjee)\
**Post date:** [September 30, 2016, 6:01pm UTC](https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691/3 "2016-09-30T18:01:57Z")

</div>

Does shell module work without python2.7 installed at remote machine?

Thanks & Regards,  
Sourav

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [September 30, 2016, 6:17pm UTC](https://forum.ansible.com/t/raw-module-run-background-tasks-on-remote-machine-using-nohup-and/22691/4 "2016-09-30T18:17:54Z")

</div>

no
