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:
- 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.
- 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. ![]()
May 24th, 2006 at 5:27 am
It’s just “Planet”
May 25th, 2006 at 11:22 pm
Duly noted, Jeff. Thanks for all your hard work and Sam’s!
June 13th, 2006 at 12:21 pm
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…
July 13th, 2006 at 1:11 pm
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…
November 24th, 2006 at 4:52 pm
thx, after one hour try and error I googled and your blog post was the solution