https://prefect.io logo
Title
h

Hedgar

03/22/2022, 6:32 PM
What's the best way to set up a cronjob in a local machine with prefect code within a virtual environment. Currently did
pipenv shell prefect  agent local start
inside a sh script which I hands over to crontab like this
07 18 * * 1-5 bash startagent.sh
this works for sometime but suddenly stop saying it can't find or recognize those commands
k

Kevin Kho

03/22/2022, 6:44 PM
Hey @Hedgar, what is the goal here, run the agent with cron?
h

Hedgar

03/22/2022, 8:21 PM
Yes, you may want to know that this is necessary because lambda start and stops the ec2 instance therefore upon starting the instance I want to
prefect agent local start
k

Kevin Kho

03/22/2022, 8:27 PM
Could you give me an example of an error?
h

Hedgar

03/22/2022, 8:40 PM
/bin/sh: permission denied
Under the cronjob code is
07 18 * * 1-5 bash /home/ec2-user/startagent.sh