Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
11–20 of 94 posts
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#12You can also use https://r1softstorage.com/ and receive storage + R1soft license (block based incremental backups) -- or just purchase the $5/month license from them and use storage where you want.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#13For a database driven dynamic site or a site with content uploads you can also use your version control via cron job to upload that content. Have the database journal out the tables you need to backup before syncing to your DVCS host over choice.
If you're looking for a backup service to manage multiple servers with reporting, encryption, dedupelication, etc. I'd love your feedback on our server product: https://www.jungledisk.com/products/server (starts at $5 per month).
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#14I 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.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#15What type of site is it?
Important question. If it's a Wordpress site, then all you need to back up is the theme and your MySQL db. If it's a static site then just use rsync or sync to a git service.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#16Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#17Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#18I 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.
It took a little time to set up, but it is conceptually simple, very inexpensive (especially if you set up S3 to automatically send older files to Glacier, and/or remove old backups every now and then)... and I like that the backups are off-site and stored by a different company than the web hosts.
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#19DigitalOcean 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...
Re: Ask HN: How do you back up your site hosted on a VPS such as Digital Ocean?
#20Write 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 ever…
I don't delete and/or gzip my oldest uploads though.
#!/bin/sh
DATE=$(date +%d-%m-%Y@%H:%M:%S.%3N)
DB_USER="qux"
DB_PASS="foo"
DB_NAME="bar"
DROPBOX_TOKEN="baz"
/usr/bin/mysqldump -u${DB_USER} -p${DB_PASS} ${DB_NAME} > /tmp/${DATE}.sql
/usr/bin/curl -H "Authorization: Bearer ${DROPBOX_TOKEN}" https://api-content.dropbox.com/1/files_put/backup/ -T /tmp/${DATE}.sql