# inkyPhat Crontab

**URL:** <https://forums.pimoroni.com/t/inkyphat-crontab/7557>\
**Category:** Support\
**Created:** [April 17, 2018, 4:28pm UTC](https://forums.pimoroni.com/t/inkyphat-crontab/7557 "2018-04-17T16:28:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Virgilio](https://avatars.discourse-cdn.com/v4/letter/v/c37758/32.png) [@Virgilio](https://forums.pimoroni.com/u/Virgilio)\
**Post date:** [April 17, 2018, 4:28pm UTC](https://forums.pimoroni.com/t/inkyphat-crontab/7557/1 "2018-04-17T16:28:43Z")

</div>

This InkyPhat is a really cool device. However, Crontab won’t run it for some reason. I have it currently set up to run every 1 minute and at reboot. This is just to test it out, I’ll eventually set it to every 10 minutes. This is sudo’s crontab:

> \*/1 \* \* \* \* python /home/pi/Pimoroni/inkyphat/examples/weather.py

> @reboot python /home/pi/Pimoroni/inkyphat/examples/weather.py

I suspect crontab doesn’t know how to look in the /resources file for the backdrop.png file because if I run from my shell:

> $ sudo python /home/pi/Pimoroni/inkyphat/examples/weather.py

it tells me:

> IOError: [Errno 2] No such file or directory: ‘resources/backdrop.png’

Can anyone help me correct this please?

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [April 18, 2018, 8:56am UTC](https://forums.pimoroni.com/t/inkyphat-crontab/7557/2 "2018-04-18T08:56:56Z")

</div>

You’re right. The issue is one of context, `crontab` is not running `weather.py` in the directory `/home/pi/Pimoroni/inkyphat/examples/`, and so the Python script can’t find any of its resources (in this case, `backdrop.png`)

You need to ensure the script is run in the right directory, which you can do by preparing a simple launcher script to run it:

`nano /home/pi/weather.sh` \>

```auto
#!/bin/bash

cd /home/pi/Pimoroni/inkyphat/examples/
python weather.py

```

Then your crontab entry should be `*/1 * * * * bash /home/pi/weather.sh`
