Oct
23
2008
2

super simple wordpress backup

I use an app called gtimelog to track the time I spend on projects. It’s a very simple app which doesn’t get in the way. I’ve been pretty happy about it for the last 6 months or so. A couple of days ago it started corrupting it’s datafile and I didn’t have a recent backup. Putting only a couple of days worth of data was pretty painful so I decided to give dropbox a try.

All the software does is synchronize ~/Dropbox with your online storage. You get about 2Gb for free which is more than sufficient for what I need.

Lesson learned, I won’t run into this problem again. I have cron spawning a script every hour or so which compares the file with the previous version and drops a fresh copy in ~/Dropbox if it changed.

Then I started thinking, what about backing up wordpress sites this way. I don’t exactly care for the SQL dumps. Installing wordpress from scratch is easy and fast enough. I do care about the content, more specifically about the WXR dumps but I don’t have any desire to go in there every day and do a manual dump. Getting to those dumps from the outside turns out to be pretty easy. Just put a file with something like this in the toplevel directory of your blog:

    <?php
          include 'wp-config.php';
          include ABSPATH . '/wp-admin/includes/export.php';
          export_wp();

Done! Simple isn’t it? The XML is streamed to standard out which means you can call this with a webbrowser.

Make sure you give the file a hard to guess name. Kind of sucks to see an exact copy of your content show up somewhere else, doesn’t it? I used a random string, pulled that through md5sum and tacked .php onto that. Try guessing that :)

Then, to actually execute it automatically add this to your crontab

  wget -O - http://example.com/hardtoguessfilename.php \
       | gzip - > ~/Dropbox/dump.gz

The dump will be automatically synchronized within seconds and you have something less to worry about.

Written by jeffry in: wordpress | Tags: ,
Oct
05
2008
0

Elections or carnaval?

Had a lot of fun watching Brazil vote today.  As Brazilians usually do, they made a big party of it.  You can’t vote without having a churrasquinho and some afterwards. I’m down with that.  Even though bars had to stay closed, the beer brands did well today.

I became rather frustrated with the pre-election campaigns.  I’m not used to the kind of spam and nonsense each candidate is stuffing down the throats of their voters.

They put your mailbox full with crap and call you at home.  Or run a parade through your street at 8am in the morning.  Big speakers screaming their candidate’s number mixed with samba.

Glad we got that behind us.

Anyway, enough rambling. To tell you the truth, I was actually quite impressed. Voting closed at 17:00. The news at 19:00 reported 73% of the votes in Belo Horizonte already had been counted. 70% nationally. 2 hours is pretty damned fast.

By midnight the results will be in and when I wake up tomorrow morning someone will probably already have cleaned the mess in our street.

The mess created when I voted last time back home still hasn’t been cleaned up.

flyers.jpg

Written by jeffry in: Brazil | Tags: , ,
Oct
04
2008
0

It’s a boy

Just like children, blogs are born every few minutes.  I helped deliver quite a few of them (blogs, not children).  Over the last year I developed lots of wordpress websites, but I never got around to create my own.

So here it is, JeffryDegrande.com.  It’s a boy, weighs 19 plugins and has blue eyes.

No, seriously, I want to burn my feed and I need a post for that.  I promise I’ll noindex it

Written by admin in: Uncategorized |

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes
beardflyers.jpgflyers.jpg10/01/2008Internet usage in brazil .. low numbers, still a big differenceherbalife070120_downloadcharlientjedscn2682dscn2685