Skip to main content

Blog Backup & Wget

I posted a question to blogger support about a week ago about backing up my blog. I had realized that I had all this work out there, but I was completely relying on their servers to keep my work safe. I also had no easy way to move the data over to my own FTP server if I ever wanted.

This was a few days before weblogs.com abruptly closed.

Blogger posted a solution on their help site under advanced topics. Their solution was to make some complicated manual configuration change to put all your blog entries on one page, then save it. I was not in a rush to do this. I was tempted to just go out and browse each entry and save it.
I had also set the option to have blogger email me each post, and I set up a filter for the emails. But there is a problem with this solution: you only get the initial entry, you don't get any updates if you edit an entry.

Then I suddenly realized that I might be able to use wget to backup my blog. Wget is a line command utility that can be used to fetch a web page.
It turned out to be even easier than I expected! All I had to do was add the '-r' recurse line command switch to the program, and it traced through all my entries and saved them to relative files on my hard drive. I was really impressed by all the great options in wget.

But I decided I wanted more. I wanted to backup my image files too (posted on my ISP web server and Hello's photos1.blogger.com server). So I wrote a shell script to extract all the image files, and put them in a list file to use with wget.
Then I updated the script to do my site wget first. And I set both wget commands to only do newer files. I run it on my windows machine under cygwin. I would imagine it would run fine under linux or other UN*X platforms.
I am sharing my script under a GNU-like open source: getmyblog.

For those running windows without cygwin, I found that there is a windows port of wget (and a bunch of other un*x utilities) at unxutils.sourceforge.net. I have tested the wget.exe program, it it works great for vanilla windows backup of a blog site, for just the html files.

On an interesting note, I had been playing with wget a few days before as a way to post xml-rpc to blogger's API (which is in deprecation - the old API will be going away). It worked very well for a simple command, but I did not test creating an entry with it. I imagine it would not be hard to make a script to upload files backed up for a blog via wget going to the xml-rpc.

Comments

Keith Horowitz said…
Update - it seems that blogger is sending an email on at least some updates. I don't know if they made a change, or I just missed it on a few edits, or if it matters what you edit.
Hm - I made a minor correction to the latest entry, but I didn't recieve an updated email. Perhaps it was because it was during the same minute as the original post? Anyway - I still say you can't count on email as a backup for your blog, but it does add to the safety.

Popular posts from this blog

Nobody Blogrolling Me?

Accoriding to wholinkstome there are a bunch of links to me. I know only some people use blogrolling, and I've seen other people have me in their lists of linked blogs. I have 30+ people in my blogrolling list on the side ---> But wholinestome shows that nobody appears to be linking to here. Should I care? Should I remind others to blogroll me? (Feels like begging or nagging.) Should I delete the ones I blogroll who use blogroll and don't blogroll me? (Seems petty.) Should I assume something is wrong with wholinksme? (I've peaked at a couple sites, I'm not there, do I need to do a full inventory?) Should I assume something is wrong with blogroll for my site, and people just can't add me for some reason? (Could it be that simple?) Maybe it is because I haven't done '100 things' yet. :) What would you do? :)

Death in the Family

My father passed away on Sunday afternoon. He had Alzheimers for a number of years. I keep explaining to everyone who expects me to be devastated that I've already done a bunch of mourning. I know the service on Friday will be sad and emotional, but so far I haven't cried. I last saw him this past summer. I am sure he recognized me, but he was already showing that he didn't know who I was. So in my mind, I started to say goodbye then. When I went to my uncle's funeral a few months ago, and saw much cousins speaking about their father, I realized that I would be in that same spot in not too long. Sometimes with Alzheimers, the person's body stay much longer after their mind has gone. My dad was just at that point of slipping both complete beyond who he was and beyond the point of living comfortably. He was no longer happy. So it was a very good time for him to have his final rest. I was glad my sister was able to be with him to the end. His lung ...

I Voted, Colorado

Voting is different here in Colorado than it was back on the East Coast. In New Jersey, and I remember it was the same basic things when my parents voted in New York, the voting was in a mechanical voting booth. You would go to a desk and sign the big book. The would give you a sheet of paper. You would take the paper over to a voting machine. An assistant would take the paper and put it somewhere on the side of the machine. You would pull a big mechanical handle that would close the curtain behind you. Then you would flip the levers to indicate your vote. After, you would push the big handle, which would record your vote, reset the levers and open the curtain. Here in Colorado, the beginning of the process is the same. You wait on line and sign the big book. I went with my wife, as she dropped her car off for service. At first she was going to vote before she dropped off her car. But she called me to tell me the line was an hour long. After I picked her up at the shop,...