# getting error when trying to use 'at' module to schedule a script

**URL:** <https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658>\
**Category:** Ansible Project\
**Created:** [August 21, 2021, 9:09pm UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658 "2021-08-21T21:09:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [August 21, 2021, 9:09pm UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/1 "2021-08-21T21:09:52Z")

</div>

I tried to schdule a script to be run at a particular time as per the instruction in documentation for ‘at’ module. However iam getting below error. Not sure what iam doing wrong, please guide.

First, i wrote a script which references another script that need to be executed in 5 minutes. Both scripts are in same directory. However when i run this script, it shows below error:

i wonder if ‘hosts: TESTFIREWALL’ is needed as iam not running this script on a remote host but i tried adding and removing it yet got error on both occassions.

---

<div class="post-metadata">

**Author:** ![Erik\_Godding\_Boye](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Erik\_Godding\_Boye](https://forum.ansible.com/u/Erik_Godding_Boye)\
**Post date:** [August 21, 2021, 9:26pm UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/2 "2021-08-21T21:26:41Z")

</div>

Is **at** installed on your hosts?

[https://docs.ansible.com/ansible/2.5/modules/at\_module.html#requirements](https://docs.ansible.com/ansible/2.5/modules/at_module.html#requirements)

---

<div class="post-metadata">

**Author:** ![Melvin\_Satheesan](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Melvin\_Satheesan](https://forum.ansible.com/u/Melvin_Satheesan)\
**Post date:** [August 22, 2021, 1:36am UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/3 "2021-08-22T01:36:08Z")

</div>

It seems environment issue. Find the ‘at’ command location and export to the binary path.

---

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [August 23, 2021, 12:49am UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/4 "2021-08-23T00:49:32Z")

</div>

Hi Erik,

no, i wanted to schedule a script to be run on a cisco switch/firewall (network device). i don’t think ‘at’ module can be installed on a network device.

so is there any other way i can schedule script to be run in device in below format?

2960 switch-1 - run 2960upgrade.yaml - run at 2:30 pm

3650 switch - 3650upgrade.yaml - run at 3:30 pm

2960 switch-2 - 2960upgrade.yaml - run at 4:30 pm

Thanks,  
Vikram

---

<div class="post-metadata">

**Author:** ![Melvin\_Satheesan](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Melvin\_Satheesan](https://forum.ansible.com/u/Melvin_Satheesan)\
**Post date:** [August 23, 2021, 3:19am UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/5 "2021-08-23T03:19:45Z")

</div>

Check kron module, it’s similar to at.

---

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [August 24, 2021, 10:42pm UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/6 "2021-08-24T22:42:40Z")

</div>

Hi,

After going tghrough documentation for cron module, i doubt if it would help in scheduling script to be executed in network devices. Are you sure it helps with scheduling for scisco network devices?

Regards,  
Vikram

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [August 26, 2021, 1:44am UTC](https://forum.ansible.com/t/getting-error-when-trying-to-use-at-module-to-schedule-a-script/35658/7 "2021-08-26T01:44:36Z")

</div>

We cannot execute any script on network devices, execution will happen only in the Ansible server . The cron job will only do the scheduling job.
