Introduction: Cron/crontab on Intel Edison
You want cron or
crontab on your Intel Edison, and it's not installed! Shouldn't it be standard on all Linux boxes? Well, you are in luck. With this 2-Step Guide you are on your way!
Of course, the Yocto folks have their own ways of using their own scheduler, but why not use something you are familiar with.
If you don't know what cron/crontab is, it's basically a very smart scheduler. It's more customizable than Window's Task Scheduler.
The first step if you have not done so, start the installation guide on your Intel Edison.
Be sure to walk through all five steps (the number of steps during the time of this writing). You need a Edison board with you to complete all five.
The next step I HIGHLY recommend is to perform this patch that will EXPAND your partition on your system. Since you bought a 4GIG device, you should be able to use it. The Intel Edison software current does not have this fix in place yet. Hopefully this article will inspire them to do so.
WARNING: If you decide to skip this step, do NOT perform opkg update more than once on your Edison. Else, you will run out of space on your Edison and have to reflash your Edison.
Step 1: Preparing to Install Cron/crontab
If you haven't done
so, plug in the power to the barrel connector. I HIGHLY recommend powering from a transformer brick from a standard 120v AV to 9-12v DC converter. The Edison will adapt the voltage to 9V.
Using the standard non-Apple, mirco-USB cable, attach it to the micro-USB port closest towards the edge of the Edison (the one away from the switch).
Find what COMM port it is using and open a serial terminal. This step will vary based on your OS and the port number your computer assigns it to.
Once you get in, you need to first install the pip command which allows you to get the Python libraries. Note: Python comes pre-installed. Issue the following commands in your serial terminal or shell.
echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/intelgalactic" > /etc/opkg/intel-iotdk.conf
Create a file called base-feeds.conf in /etc/opkg. (The instructions for that are below. If you are not familiar with VI, I highly recommend learning it)
src/gz all http://repo.opkg.net/edison/repo/all
src/gz edison http://repo.opkg.net/edison/repo/edison
src/gz core2-32 http://repo.opkg.net/edison/repo/core2-32
opkg install python-pip
pip install --upgrade pip
Step 2: Installing Cron/crontab
Once step 1 is
complete (it is MANDATORY that you do step one), you are ready to install cron/crontab.
opkg install cronie
Once complete, you can enter cron by typing
-e means to edit. -l means to list. Most of the detailed explanation you can then find publicly on the Internet like:
My favorite scheduler commands are the ones where I can start my fancy scripts on start. Simply @reboot
an example would be:
@reboot /home/pi/BTProxInternet.py > /home/pi/cronlog 2>&1
which will run my Python script called BTProxInternet.py and send the STDOUT to /home/pi/cronlog