Running cron jobs on aws elastic beanstalk - django
<p>I'm having trouble getting my cron jobs to execute.</p>

<p>Setup:</p>

<p>Django - 1.9</p>

<p>Elastic beanstalk - 64bit Amazon Linux 2016.03 v2.1.3 running Python 3.4</p>

<p>I've tried doing this a couple of ways so far:</p>

<ol>
<li><p>Using a cron.yaml file:
Didn't touch anything else - just added a cron.yaml file to my project root folder</p>

<pre><code>
version: 1
cron:<br>  - name: "test"
url: "http://website.com/workers/test"
schedule: "*/10 * * * *"
</code></pre></li>
<li><p>Using a container command and a separate cron.txt file:</p></li>
</ol>

<p>Added this line in my .ebextensions/development.config file</p>

<pre><code>05_some_cron:
    command: "cat .ebextensions/crontab.txt &gt; /etc/cron.d/crontab &amp;&amp; chmod 644 /etc/cron.d/crontab"
    leader_only: true
</code></pre>

<p>and in .ebextensions/crontab.txt</p>

<pre><code>*/10 * * * * source /opt/python/run/venv/bin/activate &amp;&amp; python mysite/manage.py test
</code></pre>

<p>The app deploys successfully in both cases.</p>

<ol>
<li>Manually (in a browser) going to <a href="http://website.com/workers/test" rel="noreferrer">http://website.com/workers/test</a> has
the intended outcome (in the first case).</li>
<li>Adding <code>source /opt/python/run/venv/bin/activate &amp;&amp; python mysite/manage.py test</code> as a management command runs the correct script once on deploying.</li>
</ol>

<p>The logs do not show any GETS on that url.</p>

<p>What am I doing wrong? Am I missing some step of the process or some setup step on EBS?</p>

<p>Also what is the best ways to run cron jobs for django applications hosted on EBS? - django apps can run management commands either from the command line as in attempt 2 or by extending a GET or POST url as in attempt 1.</p>