[email protected] ~/notes>


RSnapshot-style Backups on Dreamhost


A while ago I needed to find a good setup for backing up some machines.

I wanted to use RSync to do snapshots-like backups.

This setup is:
* Off-site
* Storage efficient (the bulk of my backup was unlikely to ever change)
* Network efficient (only transfer changed files)
* Keeps versions going back a few months

Now, DreamHost offers 50GB of free space for personal backups and that seemed a good fit for this particular situation.

Then I found RSnapshot and it was exactly what I needed.
Unfortunately, RSnapshot doesn’t backup to an external server.
It’s meant to work in a setup where the server hosting the backups connects to your data sources and pull the files.
That totally makes sense and is probably the best setup but it wouldn’t work for me.

DreamHost doesn’t have RSnapshot installed on their backup servers and the only access users have to that machine is SFTP and RSync.
I needed something that would work with just that.

I came across a post about backing up DreamHost websites to DreamHost Backups that showed a workaround to the lack of SSH access to the backups service.

So I took the idea, mixed it up with the stuff I wanted from RSnapshot and wrote a small perl script to do it.

It’s called dhsnapshot and is published at GitHub: http://github.com/carloslima/dhsnapshot

At this moment, it’s not very flexible: it’s hardwired to keep 7 daily, 4 weekly and 6 monthly backups and it’s also limited to a single backup source (you can only point it to one source directory)
But it’s not hard to change, or even make it configurable.
I might do it if I ever get the need or motivation :)

One way or the other, it should be reasonably simple to setup (instructions on GitHub).

I’d be glad to know if it helped anyone.
So, please, drop me a comment if you fnd it useful.