How to set up and manage automatic backups to a USB drive that only connects on a schedule to protect against ransomware
Summary
This guide helps you troubleshoot and resolve: How to set up and manage automatic backups to a USB drive that only connects on a schedule to protect against ransomware. Follow the steps below to fix the issue.
Common Causes
Keeping backups offline is one of the strongest defences against ransomware. If your backup drive sits plugged in permanently, malicious software on your network can encrypt or delete those backups just as easily as your live data. By only connecting your USB drive during a short, scheduled backup window, you dramatically reduce the window of opportunity for ransomware to reach it.
This guide walks you through setting up a scheduled backup that runs while the drive is connected, then safely disconnects the drive when the job is finished. The approach works on both Windows and macOS.
How the Scheduled Offline Backup Approach Works
The concept is straightforward:
- You set a recurring backup window (for example, every weekday at 11pm).
- At the start of that window, you connect the USB drive.
- The backup software runs automatically.
- When the backup finishes, the software ejects the drive and you unplug it.
- The drive spends the rest of the day offline, invisible to ransomware.
What You Will Need
- A USB drive or external HDD with enough capacity for your data. We recommend a drive dedicated solely to backups.
- A computer running Windows 10/11 or macOS 12 or later.
- Built-in backup tools (File History on Windows, Time Machine on macOS) or a third-party tool such as Veeam Agent Free, Duplicati, or Arq.
- A small calendar reminder or scheduled task to physically plug the drive in at the right time.
Quick Fix Steps
- Prepare and label your USB backup drive.
- Configure your backup software to run on a schedule.
- Set the software to eject the drive when finished.
- Create a recurring reminder to plug the drive in before the backup window.
- Test the full cycle end-to-end.
- Verify backups by performing a test restore.
Detailed Instructions
Step 1: Prepare and Encrypt the Backup Drive
- Connect the USB drive to your computer.
- Open Disk Management on Windows (right-click the Start button and choose Disk Management) or Disk Utility on macOS (Applications > Utilities > Disk Utility).
- Format the drive as
NTFS(Windows) orAPFS(macOS) and give it a clear label such asOFFLINE-BACKUP. - Enable encryption for physical security:
- Windows: Right-click the drive in File Explorer and choose Turn on BitLocker. Follow the wizard to set a password and save your recovery key.
- macOS: In Disk Utility, select the drive, click Erase, choose
APFS (Encrypted), and set a password.
- Eject the drive safely.
Step 2: Configure File History on Windows
- Connect the USB drive.
- Open Settings > Update & Security > Backup (Windows 10) or Settings > System > Storage > Advanced storage settings > Backup options (Windows 11).
- Click Add a drive and select your USB drive.
- Click More options to set the backup frequency and how long to keep backups.
- Under Back up these folders, add or remove folders to match what you need to protect.
- Click Back up now to perform an initial backup.
Step 3: Configure Time Machine on macOS
- Connect the USB drive.
- Open System Settings > General > Time Machine.
- Click Add Backup Disk and select your USB drive.
- Choose Set Up Disk and enable encryption for backups.
- Time Machine will begin its first backup automatically. Subsequent backups run hourly when the drive is connected.
Step 4: Use a Third-Party Backup Tool (Recommended for Automation)
Built-in tools are useful, but dedicated backup software gives you more control over scheduling and post-backup actions. Tools we commonly recommend include:
- Veeam Agent for Windows (Free) — supports scheduled jobs, retention policies, and post-backup scripts.
- Duplicati — cross-platform, supports encrypted backups to local USB.
- Arq Backup — paid, but excellent for macOS with strong encryption.
Whichever tool you choose, configure it to:
- Run only during your defined backup window.
- Verify the backup after writing.
- Execute a post-backup command to eject the drive.
Step 5: Automate Ejection of the USB Drive
On Windows using a Scheduled Task
Windows File History cannot automatically eject a drive. For automatic ejection, use a dedicated USB eject utility such as DevCon or a third-party backup tool with post-job ejection support. If you prefer a manual scheduled approach, use Task Scheduler to remind you to eject the drive:
- Open Task Scheduler (search for it from the Start menu).
- Click Create Task (not Create Basic Task) for more control.
- Give it a name such as
Eject Backup Drive Reminder. - On the Triggers tab, create a new trigger that runs Daily at the time you want the backup to finish (for example, 11:30pm).
- On the Actions tab, choose Start a program and enter a message or script to remind you to safely eject the drive via the system tray.
- Click OK and test the task by right-clicking it and choosing Run.
On macOS using launchd
- Open Terminal (Applications > Utilities > Terminal).
- Create a script file with:
nano ~/eject-backup.sh - Add the following line, replacing
OFFLINE-BACKUPwith your drive label:diskutil unmount /Volumes/OFFLINE-BACKUP
- Save with
Ctrl+O, then exit withCtrl+X. - Make the script executable:
chmod +x ~/eject-backup.sh - Create a launchd plist file to schedule the script. Open Terminal and run:
nano ~/Library/LaunchAgents/com.local.eject-backup.plist - Add the following content, replacing
yourusernamewith your actual macOS username:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.local.eject-backup</string> <key>ProgramArguments</key> <array> <string>/Users/yourusername/eject-backup.sh</string> </array> <key>StartCalendarInterval</key> <array> <dict> <key>Hour</key> <integer>23</integer> <key>Minute</key> <integer>30</integer> </dict> </array> </dict> </plist> - Save with
Ctrl+O, then exit withCtrl+X. - Load the agent into launchd:
launchctl load ~/Library/LaunchAgents/com.local.eject-backup.plist
- To start the agent immediately:
launchctl start com.local.eject-backup
launchctl unload ~/Library/LaunchAgents/com.local.eject-backup.plist, then load it again.
3-2-1 Backup Principle and Drive Rotation
An offline USB backup is a strong ransomware defence, but it should not be your only copy of data. Follow the 3-2-1 backup rule:
- 3 copies of your data (the original plus at least two backups).
- 2 different media types (for example, internal disk and USB drive).
- 1 copy offsite (away from your primary business location).
We recommend rotating at least two USB drives. Keep one drive connected for the scheduled backup window, then swap it with a second drive kept offsite. Rotate them weekly or monthly so you always have an offsite copy protected against fire, theft, or hardware failure at your primary site.
Verify and Restore Your Backups
A backup is not reliable until you have proven you can restore from it. Do not wait for a disaster to find out your backup failed.
- After the first scheduled backup, open your backup software and browse the backup set.
- Select a few representative files and restore them to a temporary folder.
- Open the restored files to confirm they are intact and readable.
- Repeat this verification monthly.
- Perform a full test restore at least once per year to confirm the entire recovery process works.
Troubleshooting
Drive Not Recognised
- Check that the USB cable is firmly connected and try a different USB port.
- Open Disk Management (Windows) or Disk Utility (macOS) to see if the drive appears but lacks a drive letter or mount point.
- If the drive is encrypted, ensure you unlock it with the BitLocker password or macOS encryption password before the backup runs.
- Restart the computer and reconnect the drive.
Backup Window Missed
- Confirm the drive was physically connected before the scheduled start time.
- Check that the computer was awake and not in sleep mode during the backup window.
- Review the backup software logs for errors or skipped jobs.
- Adjust your calendar reminder so the drive is connected at least 15 minutes before the backup starts.
Ejection Failure
- Close any files or applications that might be using the drive before attempting to eject.
- On Windows, use the Safely Remove Hardware icon in the system tray to eject manually.
- On macOS, click the eject icon next to the drive in Finder, or run
diskutil unmount /Volumes/OFFLINE-BACKUPin Terminal. - If a scheduled ejection task failed, check Task Scheduler history (Windows) or system logs (macOS) for the cause.
Backup Verification Failure
- Ensure the destination drive has sufficient free space.
- Confirm the source folders are still selected in the backup configuration.
- Run the backup again and check the software report for failed files.
- If files cannot be restored, contact your IT support provider via Open a Ticket.
Still Having Issues?
💻 Open a Ticket