What's the best way to set up a cronjob in a local...
# prefect-community
h
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
Hey @Hedgar, what is the goal here, run the agent with cron?
h
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
Could you give me an example of an error?
h
/bin/sh: permission denied
Under the cronjob code is
07 18 * * 1-5 bash /home/ec2-user/startagent.sh