The first thing that I wanted to do was to set-up a system that showed very quickly if the backups were running correctly. Originally checking backups was a tedious process. I would have to SSH to the box and check that the files were there, which was slow and annoying (Which leads me to stop doing it on a regular basis).

In the new management system I wanted to have a “dashboard” when you first login that shows the health of the site. First one that I want to cover was the backup check. This “widget” needs to show me in a few seconds if everything is OK, of if there is something I need to look into.

Overview

So the backups are run by script on a daily basis at approx 2:15am. Each database is backed up to its own file in a folder with today’s date. What the widget needs to do is not only check that the folder is there but that what is in the folder is what we expect (i.e. is there a backup file for each sub site?). There is little point running a backup of “stuff” and not actually backing up what we need to backup.

So lets get in a see how it was done.

Now that is complete all there was to do was to link to the file from the main page. As you can see from the different states below the widget either shows a nice green tick or an error with additional information (i.e. what files are missing)

All is well

All is well

FAIL!

FAIL!

As you can see this provides a very quick, yet accurate insight into the heath of the backups. I do plan to create another widget that will show the backup health in relation to the retention available but after thinking about it that is different to if the backups have run or not.