Spamtastic!

By , June 16, 2009 1:33 pm

This weekend saw a sudden surge of spam comments coming my way. Strangely though, the comments seem legit. No links to various websites, not random text – nothing. Just a few sentances that are so generic they seem relevant.

I let the first couple through – It wasn’t until I noticed i had comments from several different ‘people’ all from the same IP that I started to question it. Further investigation reveals a peculiar email address and that every ‘person’ has google as their website address.

Apparently this was a massive spam attack

So, for those with blogs beware. Comments along these lines should marked as spam:

KattyBlackyard
google.com
katty@ds4ns1ns2.cn
89.28.14.35
Submitted on 2009/06/15 at 11:09am

I really like your post. Does it copyright protected?

Scheduled PostgreSQL Database Backups

By , June 11, 2009 8:37 pm

I’ve just started using PostgreSQL as my database of choice for a few projects, and needed some way of scheduling backups. As a result I’ve created the following small bash script that will backup a given database and put it in a gzipped tar archive.

You can find the script in my svn repository here.

Usage is pretty simple:

backup_pgsql dbname

where dbname is the name of the database you want to backup.

By default, the script tries to put your backup in /tmp/ – you can change this behaviour by modifying the BACKUP_DIR variable in the script – make sure to include the trailing / though.

Now, of course this is only the backup part. To schedule this, you can edit your crontab file (usually found in /etc/crontab) and include a line like this:

1  3  * * *     root    backup_pgsql dbname

This will backup the database, dbname, at 03.01am every day. Assuming your backup_pgsql is in your PATH. I put mine in /usr/local/bin/ and chmod +x it. If you don’t want to do that, simply provide the full path to the script.

Panorama Theme by Themocracy