Mirror to USB drive: wait and retry until USB connected

Discuss new features and functions
Posts: 2
Joined: 1 Mar 2021

Colink2

I currently have a batch process set up to copy user documents to a removable drive.

Windows Task Manager runs the batch every week.

Is there an option in FFS that will first look for the USB drive, if not present, re-try X times with Y delay between attempts.

My current workaround. Set FFS to re-try “on error” X times with Y delay. This is not quite the same as my desired function above. If I understand re-try on error correctly, if it found an error in the reading of the source files it would keep re-trying to read and would stop when before it got to realise there is no USB.

Supplementary question:
If I understand correctly FFS sees a file in use by another process as an error. As I will never want to write to an “in use” file is it possible to tell FFS to copy all filtered files irrespective of being “in use”?
User avatar
Posts: 2451
Joined: 22 Aug 2012

Plerry

> Windows Task Manager runs the batch every week
I suppose you mean the Windows Task Scheduler.

The Windows Task Scheduler has the option you seem to be looking for.
On its Settings-tab the Task Scheduler has an option "If the task fails, restart every X (minutes/hours), Attempt to restart Y times"
Obviously, if the Task Scheduler manages to start FFS, it does not consider this as "failed" and will not restart, even thought FFS will not be able to run its actual sync.
So we need to make the Scheduled Task fail to start the task if the USB drive is not present.
Never tried this, but ...
On the Actions-tab of the Task Scheduler you specify the Program/script to be started by the task. If you have a portable FFS installation (donation edition only) installed on your USB drive, you can point to that. If the USB drive is not present, this will fail and should cause an attempt to restart the task.
If you do not have a portable FFS installation installed on your USB disk, you can create a script file (e.g. a *.bat or *.cmd file) on your USB drive just comprising the proper command line to start FFS (that may now be installed e.g. on your desktop, and the desired FFS configuration file to be run. In the absence of the USB drive, the Task Scheduler should fail to start the script and cause an attempt to restart the task.

But perhaps there are even more ways to solve this problem.

> Supplementary question
Consider using Volume Shadow Copy