Settings

Theme

Show HN: Regular MySQL Backup to Email

github.com

7 points by tariky 4 years ago · 3 comments · 1 min read

Reader

Hi, everyone. I got big flood last week. Weather was crazy and water got to my company warehouse. Luckily company local server was not in that room. Of course I was to lazy to set up any automatic off site db backup. But now I got it working. I wanna hear you thought? Is it smart to use email for db backup or should I just upload it to remote server?

For those lazy like me, try to setup this app and give it a go.

scrapheap 4 years ago

Near misses are great for reminding us to check our back ups :)

I'd advise against using email for sending the actual backups as there's quite a few security risks and a lot of technical things that could catch you out over time (e.g. hitting size limits as your database grows).

As an alternative you could use a secure upload to a remote location for transferring the backup file and then email yourself on any failures.

LinuxBender 4 years ago

My personal preference for my hobby sites is to do a backup locally and compress with p7zip using the fastest compression and breaking it up into smaller chunks. I then use the lftp client via cron to back up the .7z.0xx files to a chroot sftp server elsewhere. The SFTP server also runs rsnapshot to keep copies where the SFTP user can not tamper with them.

Then another db in another region pulls down that backup, decompresses it and loads it and a script does a query for a known set of data. If the test fails I get an email. This is a very simplistic test. Proper DBA's would implement far more advanced validations than what I am doing.

It isn't as fast as real time replication but has the advantage of testing my backups and giving me a few ways to get out of a tangle. This method gets slower with much bigger databases. One could still do real time replication in addition to this.

Komodai 4 years ago

Sending over email does not sound like a good idea at all, and for several reasons.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection