Irrigation – Part 4: Automatic Database Backup

I just went trough a Scottish shower of emotions. IT people know this very well. I had the plan to “just” activate the eth0 interface on my RaspberryPI to get if off my WLAN. Unfortunately that was not so easy. For a moment I was afraid I had to power it off. I previous cases this caused a damaged file system. I was lucky, there was no such problem but I realized that I don’t have any backup of my database at all.

I’m not that kind of guy that has several servers running 24/7 in his house so I decided to put the backup into my Dropbox. I create a folder called rpi2backup in my Dropbox and a folder /tmp/dbbackup/ on my Raspberry. For uploading my backup file I use the uploader from Andrea Faprizi. After installing the uploader I just follow the instruction of the installer. I don’t know exactly why but I had to do the procedure twice.

The next step is the MariaDB backup. I will not reinvent the wheel here so I just follow the tutorial here. I have modify the script in the tutorial a bit to upload the backup automatically after creation.

Now I will sleep better.

Leave a Reply