# Using bash \<file\> in ansible playbook from cron

**URL:** <https://forum.ansible.com/t/using-bash-file-in-ansible-playbook-from-cron/26037>\
**Category:** Ansible Project\
**Created:** [November 15, 2017, 3:55pm UTC](https://forum.ansible.com/t/using-bash-file-in-ansible-playbook-from-cron/26037 "2017-11-15T15:55:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.haney](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@mark.haney](https://forum.ansible.com/u/mark.haney)\
**Post date:** [November 15, 2017, 3:55pm UTC](https://forum.ansible.com/t/using-bash-file-in-ansible-playbook-from-cron/26037/1 "2017-11-15T15:55:05Z")

</div>

Bear with me here, since this is one odd problem. I have a playbook that I’m trying to run from cron. One step in the playbook is to execute a series of commands in a plain text file like:  
rd.pl   
rd.pl

This has to be done using 'bash '. When running this in a console it works just fine. However, when running from cron it fails with ‘rd.pl: command not found’. This might be a path issue, but I’m not sure how to fix it. FWIW, this perl script isn’t one I built and nothing I do fixes the fact it’s crap and refuses to take proper arguments, etc. Is there a way to make this behave other than just running this playbook in a for loop in a screen session?

---

<div class="post-metadata">

**Author:** ![Jon\_Adcock](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@Jon\_Adcock](https://forum.ansible.com/u/Jon_Adcock)\
**Post date:** [November 15, 2017, 6:10pm UTC](https://forum.ansible.com/t/using-bash-file-in-ansible-playbook-from-cron/26037/2 "2017-11-15T18:10:46Z")

</div>

Try specifying the full path to the rd.pl file in the playbook that actually runs rd.pl, e.g., /some/directory/path/rd.pl  
Jon
