Now download the script by running the following command:

wget http://www.cuttingcords.com/s/update.py

We now need to set it up to run on a schedule, so enter the command:

crontab -e

This will open a text editor which will likely be blank. The formatting of a cron job is in this format:

* * * * * command to be executed | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +--------- month (1 - 12) | | +------------- day of month (1 - 31) | +----------------- hour (0 - 23) +--------------------- min (0 - 59)

You now need to pick out a schedule of how often and when this script will run. Feel free to have this trigger as often as you want since it will only download the update if its new. In other words, the script is smart enough not to download the same version over and over again. With that said, it does require a reboot to apply an update, so you will probably want to schedule the update late at night to prevent it from running while someone is using the system.

I personally have mine update at 4:30 AM every Wednesday morning since I'm fairly certain no one would be up at that ungodly hour. Using the cron format, this works out to be 30 4 * * 3. The command we want to execute is python /storage/update.py. So I enter this into the blank document:

30 4 * * 3 python /storage/update.py

When you have your job entered in with a schedule that works for you, press Ctrl+X to exit. It will prompt you to save, press y. It will ask for a file name but one will already entered, simply press Enter.

If you're paranoid and want to make sure it was scheduled, enter this command:

crontab -l

The script is now all set and will run at the scheduled times.

Testing it out

Now let's give the script a test spin to make sure it runs as expected. In putty, type this command:

python update.py

The first time the script is run, it will execute the update process even if you are on the newest version so that you can verify it works. Subsequent runs will stop if there is not a new update. You should see status messages like the ones below: