For anyone that has maintained a system built on amazing charts for more than a few weeks, you’ll know exactly what I’m talking about right from the title, but for everyone else let me fill you in:
Amazing Charts is an amazing program, or so the people that I maintain it for say on the days it’s not making them pull their hair out. It has gotten a lot of things right, and does many tasks in ways that I’ve seen other EHRs complicate needlessly from just a few clicks. Unfortunately it can be a pain to support on the back end if you don’t make the proper preparations. One of those preparations is dealing with the programs unruly backups. You see, every night Amazing Charts makes a backup, and this is GREAT! I wish every EHR out there had this as a standard feature, but like a wish from a Genie, this nightly backup comes with a complication or two
- It puts that backup in the same folder as your database, for you non-techies read as: It’s taking up prime real estate.
- It never deletes any of these backups. While that might sound like a good thing it means that the default SQL backup function, will fill your database drive up in a matter of days (or weeks) if left unchecked. Since you can’t change, you can only only add redundancies to it, this nightly back up will make your application slow down and crash.
So what’s the solution?
You need to have something in place that deletes those backups, or at least moves them around without you needing to do it manually every few weeks. I have a solution in mind just for this situation. You’ll need to leverage a few tools built into Windows to get this to work, but you won’t likely have to install anything new.
NOTE: If you feel uncomfortable doing any of this, please contact a qualified technical professional to help you.
Step one: make a new batch file by creating a simple text file anywhere you want, and renaming it with the .bat extension, and copy and paste this script in to it:
@echo off
Title: Backup File Manager
Echo Backups older than 7 days are being staged for deletion!
robocopy “G:\amazing charts\backup” G:\Old_Backups /MOV /MINAGE:7 /PURGE
Pause
What this will do is use robocopy to move “/mov” the backups that are older than the minimum age “/MINAGE:7” in “G:\amazing charts\backup” to “G:\Old_Backups” and then purge “/purge” the target folder of all files that don’t have a matching copy from the source, then include a pause so you can see that the process completed and read the log.
I have this example set to move every 7 days, but for your own needs you could move them as often as you’d like. For example, if you have bulk storage somewhere you’re not using you could dump them there.
Amazing Charts recommends that you keep 7 days plus 1 month. To accomplish this, you could modify this script and the task scheduling to include a monthly version of this script that only transfers the current backup with a max age of 1, but more on that later.
Once you have your batch file, we can move on to the next part: making it run automatically!
To do this we will use Windows Task Scheduler. Just search task in Windows and it will come up. From there we will add a new task by clicking on the “Task Scheduler Library” on the left side of the window and then click create new task. We will then need to give our task a name, make it something useful to you and anyone that might administer this computer with you. Then we need to add a trigger and an action and we’re done!
The trigger in this case will be a scheduled event. We want our backup to happen nightly, so we will choose the “On a schedule” option, then select Daily, then the time of day we want, and how many days we want it to happen.
For the action, we want to run a program. That program is the .bat file we made before. Navigate to it, save this action, and we should be good to go! The last step is choosing to allow it to run while we’re not logged in (that’s kind of the point right?). Give it the highest privileges and save the task, and you’re ready to go. Of course even with all of this in place you still need other solutions to manage your backups and ensure they are conforming to the 1-2-3 rule we talked about earlier. Having something like this in place can make the rest of your backup framework not only easier but, in many cases, much cheaper!
Monthly Script
If you’re interested in ensuring those monthly backups are working correctly as well, you could use this script in place of the bat file we used earlier. Schedule it with a monthly trigger to then have all of your bases covered:
@echo off
Title: Backup Manger Monthly
robocopy G:\monthly G:\bimonthly /MOV /PURGE
robocopy “G:\amazing charts\backup” G:\MONTHLY /MAXAGE:1
Echo Monthly Backup Copy Process Complete!
Pause
This will COPY one backup a month and delete the last months backup meaning that you will, with both of these in place, have 7 days plus one a month backed up in case something goes very badly wrong.