CDB cat dog-egories:

April 13, 2005

Note: CogDogBlog has a new WordPress powered home at All entries from this version have been moved there, so as a guide dog service try finding this article in its new home by title search.

The Dog Ate My Comments

Yesterday I was trying to clean out a swath of comment spam on a blog we set up for one of our college's sites, wiping directly from the database, e.g.:

DELETE FROM mt_comments WHERE comment_blog_id=XX AND comment_author like "%poker%" DELETE FROM mt_comments WHERE comment_blog_id=XX AND comment_text like "%cialis%" DELETE FROM mt_comments WHERE comment_blog_id=XX AND comment_email like ""

It's kind of fun watching them go wooshing down the drain in batches like that.

Apparently one of my commands was a little too aggressive (where I took all out above a certain ID and forgot to restrict it to the one blog), and I've munged all comments since September 2004! Oh well, that's why I have hourly database backups...

Back we go into the depths of the database, armed with a wrench and a grease gun to patch things up....

Update: Gulp. My backup scripts were dying over the last 2 months. Now they are fixed. But alas, my comments going back the last 8 months was flushed. Oh well. Not important, eh? How about adding some new comments?

blogged April 13, 2005 06:56 AM :: category [ web bad dog ]
Comments About "The Dog Ate My Comments"
RSS Feed for comments on this entry
RSS Feed for all CDB comments

Nothing like a disaster to show you your disaster recovery scripts are broken. :-)

I really do hate the captcha (?) you've got going on here... At least the numbers are fairly legible...

I use the following script to back up my MySQL databases; I stuck it in /etc/cron.daily/01MySQLBackup on my Fedora box:


STAMP=$(date +'%Y%m%d')

if [ ! -e ${BACKUP_DIR} ]; then
mkdir -p ${BACKUP_DIR}

find ${BACKUP_DIR} -ctime +7 -exec rm {} \;

for db in $(mysql -Bse "show databases"); do
mysqldump ${db} | bzip2 --best --stdout > ${BACKUP_DIR}/${db}.${STAMP}.bz2

(bet *that* gets mangled...)

Commented by: blalor on April 13, 2005 12:04 PM


Yes, I am discovering my technical goofups on a regular, daily basis. I am human and truth be known, pretty much a sloppy programmer.

My backup script was fine- it was those pesky file permissions when I moved the directory where the dumps are stored to a new location. Our backups do a bit more. There are hourly saves of everything in one backup file, and than on a daily basis, all databases are backed up as separate dump. Furthermore, we archive the previous month's data just in case.

And why exactly do people get so bent our of shape on captchas? I have seen the ones where you have to squint a bit to get 'em right, but when you compare the extra task of mimic typing in numbers to a total denial of 1000s of Porn, Pills, and Casino attacks, it is a small price to pay.

Unless anyonew wants to defend the posting of betiality and incest photo sites to an educational web site??

Commented by: Alan Levine on April 13, 2005 12:26 PM


Dude... c'mon, come over to WP, you know you want to, c'mon now...

Commented by: James Farmer on April 13, 2005 04:55 PM

Spammers Have Force Our Hands...
Note: Those nasty blog-spamming roaches have forced us to take action to prevent their spread- all entries made to this blog will remain open for comments for 30 days after the original posting date. After that, it is old news anyhow, correct?

If you really need to make contact with the chief dog around here, please submit a request via our feedback center