Live data from Hacker News

Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

news.ycombinator.com

61–70 of 94 posts

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#61

DigitalOcean has a droplet backup solution priced at 20% of the monthly cost of your droplet. Doesn't get much easier than that, if you can afford it. For a small droplet ($10/month) that's a full backup of everything for a buck a month. https://www.digitalocean.com/community/tutorials/understandi...

Is 20% of $10 a $1.00?That said, if you have a small application, I would pay DO to pack it up. They have global servers & imaging/snapshots. Your app would prob be good if you can get away with that kind of hosting. I do believe you can take images and snapshots and download them, so using the api, a user could prob rig up a script to make it refundant if it was mission critical

I don't think that separating your hosting and backup providers is only necessary for "mission critical" things. If you don't have at least three copies of some data, in at least two distinct physical locations/services then it doesn't exist.

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#62

Earlier quoted context omitted.

You can actually set up app folders in Dropbox so that a particular API key effectively chroots you to that folder. The attacker would only get the backups.

Which is literally the worst scenario. An attacker owns your box and now your backups.

Well, maybe second-worst. The worst would be them getting all your Dropbox files.

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#63
post #32

I use AWS S3 for this as the storage prices are so cheap, at $0.03 per GB. I recommend using a utility called s3cmd, which is a similar to rsync, in that you can backup directories. I just have this setup with a batch of cron jobs which dump my databases and then sync the directories to s3 weekly.

I use duply (a simpler CLI front-end to duplicity) for doing encrypted incremental backups to S3. The only annoying thing is that duplicity uses an old version of the boto s3 library that errors out if your signatures tar file is greater than 5gb unless you add `DUPL_PARAMS="$DUPL_PARAMS --s3-use-multiprocessing "` to your duply `conf` file. Took me days to figure that out.

Duplicity is great! I use duply to back up my photos to Backblaze B2, which is really cheap: 0.005$/GB/Month.

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#64

Earlier quoted context omitted.

You can actually set up app folders in Dropbox so that a particular API key effectively chroots you to that folder. The attacker would only get the backups.

Which is literally the worst scenario. An attacker owns your box and now your backups.

How do you avoid that with any backup service?

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#65

Earlier quoted context omitted.

Which is literally the worst scenario. An attacker owns your box and now your backups.

How do you avoid that with any backup service?

Push to an S3 bucket with upload only credentials with versioning turned on.

Your master account (or superuser IAM account if you're paranoid) gives you read/write after 2FA login, but you could share your backup creds with the world and never have your backups pulled out or overwritten.

Use S3 lifecycle rules to expire backup objects after x days; data transfer in is free, the operation requests are pennies per thousand, only the bandwidth is expensive (10 cents/GB) to retrieve the backups when you need to perform a restore (even then, still very cheap).

Also, by storing in S3, you can backup and restore from anywhere.

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#66

DigitalOcean has a droplet backup solution priced at 20% of the monthly cost of your droplet. Doesn't get much easier than that, if you can afford it. For a small droplet ($10/month) that's a full backup of everything for a buck a month. https://www.digitalocean.com/community/tutorials/understandi...

It's always good to have your backup off-site. If something happens to DigitalOcean servers, your backups will be gone too.

It also protects yourself in the event your relationship with DigitalOean goes sour (e.g. CC expires, they're unable to notify, account gets deleted.)

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#68

I use AWS S3 for this as the storage prices are so cheap, at $0.03 per GB. I recommend using a utility called s3cmd, which is a similar to rsync, in that you can backup directories. I just have this setup with a batch of cron jobs which dump my databases and then sync the directories to s3 weekly.

Agree, s3cmd is simple and effective. I have written bash scripts to regularly take db dump and put it on S3. Same can be done for folders.

Also you can configure s3 buckets to delete files older than X days. For non critical projects I tend to set this at 30 days. This way the total storage used by the backups doesn't grow beyond a certain limit and helps you to control the spending.

Here are the relevant docs: http://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecy...

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#69
post #62

Earlier quoted context omitted.

Which is literally the worst scenario. An attacker owns your box and now your backups.

Well, maybe second-worst. The worst would be them getting all your Dropbox files.

No, the worst case is actually losing your data ...

Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?

#70
I don't know what the OP is running OS wise but if it's any modern Unix variant it uses ZFS. And a simple ZFS send/receive would be perfect. There are tons of scripts for that and replication.

If you're not using a modern Unix variant with ZFS... well there isn't a good reason why you would be.

Post reply on HN