Task Scheduling in amazon EC2 ubuntu instance
<p>I'm trying to run a python script every 2 minutes in an amazon EC2 ubuntu instance and i've tried a lot of things that just aren't working.</p>

<p>Could someone help me? </p>

<p>Thanks!</p>

<p>What you want to use is cron, a Unix service that allows you to schedule commands to be executed at certain times or intervals.</p>

<p>It is based on a simple configuration text file, the crontab (from "cron table", as in, the table with scheduled commands), which coincidentally is also the name of the tool to edit the file.</p>

<p>In order to edit your user's crontab, use this command: <code>crontab -e</code>
This will open your crontab file in a text editor.</p>

<p>Three things you will want to keep in mind about cron:</p>

<ol>
<li><p>You should specify the full path to your scripts, otherwise cron will not know where to find them.</p></li>
<li><p>There's a crontab for each user and the scheduled commands are executed as the user who owns the crontab file.</p></li>
<li><p>Cron's resolution doesn't go below the minutes, i.e., you can't execute something every X <em>seconds</em>.</p></li>
</ol>

<p>This should work for you:</p>

<p><code>*/2 * * * * /usr/bin/python /path/to/your/script.py</code></p>

<p>I suggest you have a look here: <a href="http://corntab.com/" rel="nofollow">http://corntab.com/</a>
Look at the syntax and the examples, it should be enough to get you going, as well as help you create more crontabs.</p>

python amazon-web-services amazon-ec2 task schedule