How to cancel a FFS batch job when removable drive isn't connected

Get help for specific problems
Posts: 11
Joined: 27 Jan 2023

Buddy

I'm using FreeFileSync to back up to a removable drive. The backup details are saved in a FFS batch file that is run by Windows 11 Task Scheduler.

When the removable drive is not connected, FFS tries to run the batch job and pops up error messages about its inability to find the drive and folders to scan and compare.

Is there a way to set up the batch file or the Windows Task so that the batch file either doesn't run or just shuts itself off when the removable drive isn't connected?
User avatar
Posts: 2288
Joined: 22 Aug 2012

Plerry

Consider using RealTimeSync (RTS)
The function of RealTimeSync is to execute a command line each time it detects changes in one of the monitored directories, or when a directory becomes available (e. g. insert of a USB-stick). Usually this command line will trigger a FreeFileSync batch job.
Posts: 11
Joined: 27 Jan 2023

Buddy

I'm aware of RTS and have used it before. My need is about 180 degrees opposite to that. When I'm at home, the backup drive is always plugged in, so it wouldn't trigger RTS by being attached. The backups run on schedule.

When I'm away from home and the backup drive is left at home, the regularly scheduled sync gives error messages when it can't find the backup drive. What I want is either some way to have the sync cancel itself when the backup drive is not attached or for it to at least shut itself off without error messages.
User avatar
Posts: 3611
Joined: 11 Jun 2019

xCSxXenon

You will need to create a batch script that detects the presence of the backup drive to decide if FFS should run or if the script should just terminate. Then the task should run that script
Posts: 11
Joined: 27 Jan 2023

Buddy

The last time I wrote BAT files was maybe 1993. Guess I'm gonna have to do a little studying.