Skip to content


Shell Script for PlanetPlanet CRON Job

Has Sam Ruby gotten you excited about PlanetPlanet, even though you don’t know Python from Perl? Got it running, but don’t have a clue how to get CRON up and running with a shell script? Yeah, that was me yesterday. Google provided some help, eventually, but I’ll break it down a little more for you:

  1. Make sure all your file permissions are right. Half of my hell yesterday was having done all the work as root but not having CHOWN’d and CHGRP’d as appropriate.
  2. Use your shell script to change to the appopriate directory before invoking planet.py. I’d never really had to do that, as I’m still a babe in the shell-scripting woods. But if you go in, cd to the /path/to/your/planet.py, then invoke ./planet.py /path/relative/to/config.ini, you’ll be rockin’.

My shell script looks like:

#!/bin/csh -f
cd /home/path/to/planet
/path/to/python/binary ./planet.py ./config.ini

Now, I simplified things by putting config.ini and planet.py in the same folder. If you didn’t [for example, if you're using examples/basic/config.ini just for funsies], you’d just invoke ./planet.py ./path/examples/basic/config.ini.

Thanks, Sam, for pushing me over the edge to play with PlanetPlanet. Now it’s time to get the templates like I want them so I can start using it in production. :)

Popularity: 23% [?]

Posted in Planet, Shell Scripts.


5 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Jeff Waugh says

    It’s just “Planet” ;-)

  2. Geof F. Morris says

    Duly noted, Jeff. Thanks for all your hard work and Sam’s! :D

  3. floschi says

    thx, after one hour try and error I googled and your blog post was the solution ;-)

Continuing the Discussion

  1. GFMorris.org linked to this post on 6/13/2006

    GFMorris.net: My Personal Planet

    I finally got enough determination to hack on Planet enough to make it work for me; having already built a shell script to update Planet via CRON, I decided to strip most of the extraneous HTML out of the included examples/basic/index.html.tmpl to crea…

  2. GFMorris.org linked to this post on 7/13/2006

    Planet, Shell Scripts, and Binary Locations

    I ran into some issues in the last week or so with getting my Planet-updating shell script invoked by CRON; it would run when I ran the script by hand, but it wouldn’t run when cPanel’s CRON spooler would try to invoke it. I was getting th…



Some HTML is OK

or, reply to this post via trackback.