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

1–10 of 94 posts

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

#2
Write a little program in your favorite shell or scripting language that

* rsyncs the directories containing the files you want to back up

* mysqldumps/pg_dumps your databases

* zips/gzips everything up into a dated archive file

* deletes the oldest backup (the one with X days ago's date)

Put this program on a VPS at a different provider, on a spare computer in your house, or both. Create a cron job that runs it every night. Run it manually once or twice, then actually restore your backups somewhere to ensure you've made them correctly.

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

#4
I use config management to build the system (Puppet in my case, purely due to experience rather than strong preference) so it's fully reproducible. I push my data with borg (https://github.com/borgbackup/borg) to rsync.net (http://rsync.net/products/attic.html) for offsite backup.

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

#5
The simplest way for us it's to use rsync, there is this service decade old (even more) that is just perfect for the offsite backup. http://rsync.net/index.html

We basically create a backup folder (our assets and MySQL Dump, then rsync it to rsync.net). Our source code is already on git, so basically backuped on Github, and all developers computer.

On top of it, rsynch has a very clear and simple documentation to implement it very quickly with any Linux distrib.

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

#8
I use a daily systemd timer on my home machine to remotely back-up the data on my VPS. From there, my home machine backs-up a handful of data from different places to a remote server.

Make sure you check the status of backups, I send journald and syslog stuff to papertrail[0] and have email alerts on failures.

I manually verify the back-ups at least once a year, typically on World Back-up Day [1]

[0] https://papertrailapp.com/ [1] http://www.worldbackupday.com/en/

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

#10
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.
Post reply on HN