It is finished

I think (loud sound of knocking on wood) I’ve solved the Blog problem. The real difficulty was in understanding how the web logging software I use, Greymatter, stored its data. It’s not documented anywhere. And There’s an awful lot of uncommented Perl code to parse. Fortunately there’s a new Greymatter support site, Greylogs, with an active technical forum. I was able to glean enough information from there to be able to fix the problem.
The following will only be of interest to webmasters running Greymatter.

Greymatter stores all entries and comments in numbered CGI files in the archive directory. Those are the only files that matter aside from any uploaded image files which Greymatter also stores in the archives directory. You can literally backup the *.cgi and *.jpg files from the archives directory, blast everything else out, reinstall Greymatter, restore the CGI files, run the Diagnostics and Repair routines, rebuild everything, and all will be well. In other words, Greymatter creates all the other files on the fly from data stored in the *.CGI files.

The problem I had, and I have no idea how it happened, was that entries had been added out of order. Normally the entry names are sequential, starting with 000001.cgi, then 000002.cgi and so on. For some reason some of my last entries were in the earliest spots. I reorganized the entries by cutting and pasting, changing the entry number in the CGI file (it’s the first word), then renaming the file. Once they were all sequential I blew out all the generated files like gm.html and archives.html and rebuilt. It took a while, there was a lot of rebuilding to do, but it all seems to have worked. Everything from the entire year is there and in the proper order.

The upshot of all this is that all it takes to backup the blog is to copy the *.cgi and *.jpg files from the archives directory. Everything else can be recreated. Greymatter should really use a more logical directory structure for this — an entries and images directory, for instance — but now that I understand what’s happening I think (sound, once again, of knocking on wood) I can keep it running for a long time to come. Phew.

9 Replies to “It is finished”

  1. I am glad to hear that you got it fix. If anyone could fix the problem, the great Leo could. I hope you and your family have a great New years

  2. Hey Leo..your Blog Time is off about -10 minutes from PSt. You may wanna check it out.

  3. Happy New Year (in about 20 minutes PST) Leo..I’m glad everything’s cool with the Blog. God Bless!

  4. Thanks, Jake. I was afraid of that. I should have looked at the code before adopting it.

  5. Hey Leo,
    In hopes you read this post: You are the best part of TechTV. Although, I wish you had more Unix related stuff on TSS. I love anything and everything you do. Great work. Thanks a lot.
    About your blog:
    I do Unix System Administration and Perl Programming for a living and I have a few comments about the Graymatter blog software. I’ve taken a cursory look through the code. And quite frankly, it’s horrible. It’s riddled with many common problems including very outdated Perl4 style code, global variables, a lack of taint, sanity, and error checking to name some obvious issues. With very little work one could almost certainly find an exploitable hole and cause problems for the hosting web site.
    If there were only a few problems with this code I would be more than willing to offer suggestions/patches, unfortunately I think it would require virtually a complete rewrite.
    I have no doubt that the author is well intentioned and is genuinely trying to help people. I think he deserves praise for his generosity. But his Perl knowlege is obviously limited and his software should not be used on a publicly available website such as yours.
    I’m sorry to be the barer of bad news and I’m sure it will be incovenient to change software. But I think it is more important that you find an alternative to Graymatter than have something go wrong. I wish I could offer advice for a different blog package you could use, unfortunately blogs aren’t something I’ve had to deal with before. Perhaps someone else can offer some suggestions.
    Good Luck.
    Long time fan,

Comments are closed.