Automate Rotating Offline Backups via USB Hub (Avoid Ransomware)

2019 July 22
Thumbnail of Hub With Backup Drives

In the world of data security, any device that is connected to the internet is a vulnerability, and using a manual backup process introduces some amount of human error. It is easy for a person manually moving and running backups to miss a day, lose a drive, or damage a drive. This blog post outlines an example of a system to minimize these risks. Seven backup drives are used together with an Acroname Programmable USB Hub to use software control to disable individual USB ports to keep all of the drives offline, only bringing them online one at a time for individual backups. Acronis Backup is used to create seven different daily backups, one for each day of the week.  


The first step is to set up the software control for the hub. Setting and saving different port states can very easily be done using the Hub Tool, but the goal in this example is to remove as much human intervention as possible. One easy way to do this is using the Acroname Brainstem C++ API. This allows for the use of the Acronis  pre/post commands to run an executable to control the hub.

Example code is available at  Follow the build instructions in How_To_Build.txt to obtain the acronisBackupExample executable used in the remainder of this post. This example is built using Visual Studio 2015 Community Edition.

Upon a successful build your file system should look something like this. The executable will be in Win32_AcronisExample\debug as AcronisExample.exe

File System Successful Build

Once the executable is built, the next step is to set up Acronis Backup. 

First, setup the USB drives to work with Acronis Backup and the Acroname Hub. Each backup drive needs to have a letter assigned that won’t conflict with other drives. Using Windows Disk Management, change each drive letter to a letter late in the alphabet. The supplied example code uses Sunday as day 0 through Saturday as day 6 for enabling ports, and the example images use T through Z for the drive letters. OS drive letter assignment is a step above sorcery, and should be treated as such. If you move any of the backup drives, double check that it retains the same drive letter when returning it to the hub.

Partition letter change using Disk Management


Once the drives are set up by letter, add them as backup destinations in the Acronis Backup Management Console.

The final step to set up Acronis is to schedule the backup plans, one for each day of the week.
Backup setup step

The file path for the working directory is C:\WhereYouPutIt\AcronisBackupExample\Win32_AcronisBackupExample\Debug.

The pre backup command will disable all of the ports on the hub, then enable one port for the day of the week. The post command uses the same executable, but with the argument ‘post’. This will disable all of the hub’s ports, and keep your backups safely offline.

Repeat this process six more times to create each day of week backup. Different styles of backup can be done on different days. For instance, it is possible to do differential backups on weekdays, and a full backup on the weekend.


Easy as that, you have daily rotating offline backups. As extra potential additions/changes, you can create a safe eject disconnect for the drives, use a batch file for the command, or set up two hubs to create redundant backups. All of the example code is on our github at Other examples can be found in the Acroname download center at

Author: Narayan


This was really informative and helpful! Thanks!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.