Page 1 of 1

Start backup if condition

Posted: 24 Nov 2022, 17:13
by dedel53
Hi

Is it possible to start the backup only if I am on same local network as the destination Nas.

Thanks

Re: Start backup if condition

Posted: 24 Nov 2022, 20:53
by cobian
No. The task will start but it will end with a "Destination not found" error.

Re: Start backup if condition

Posted: 24 Nov 2022, 21:18
by ira
Couldn't one conceptually create a batch file like:

if not exist \\whatever return error

and put in in a before event and click "cancel the task if some event fails?"

Re: Start backup if condition

Posted: 25 Nov 2022, 16:26
by dedel53
Can you please give me an example

Re: Start backup if condition

Posted: 28 Nov 2022, 20:09
by ira
dedel53 wrote: 25 Nov 2022, 16:26 Can you please give me an example
Conceptually I think you make a Before event containing a line like this:

/C if not exist \\server\SomeFolder\SomeFile exit /b -1

or make a batch file containing:

if not exist \\server\SomeFolder\SomeFile exit /b -1
exit 1

and then the Before event becomes:

/c batchfile.bat

I've no idea what Reflector considers an error that triggers "cancel the task if some event fails," but it's probably one of -1, 0 or 1 with my first guess being -1. And I've no idea if it will work. it will still need to timeout looking for the drive, but should in theory avoid trying to copy the files and failing.