whether this happy circumstance (the 'list script' works, and it works well) will continue in the future
All I can say is that I've been using that method for well over a decade and that, whilst MS do change some commands with different versions, RoboCopy is still the same in Windows 11.
finding ways if alarms can be set if a robocopy run does not 100% succeed
Yes. You can check RoboCopy's "Exit code" [also generally called its "ErrorLevel"].
Robocopy Exit Codes - SS64 ***
ErrorLevel is a variable that is, in effect, set by the processing of commands. Most commands have their own pattern of ErrorLevel usage. In general, an ErrorLevel of 0 means there were no errors.
I'll just look around for a ready-made simple example then add it to this post.
There are examples in the SS64 guide.
One of my own examples [using source & destination variables defined earlier in my script]
Code:
ROBOCOPY %SourceFolder% %DestFolder% /E /MIR /DCOPY:DAT /R:10
If %errorlevel% LEQ 3 GoTo ContinueBackup
Echo RoboCopyErrorLevel is %errorlevel%, 0-3 are OK but this is not.
Pause to swear about life's unfairness.
GoTo EndBackup
:ContinueBackup
:: This is where whatever else is being done gets done
:EndBackup
:: Pause to check proceedings during testing by removing the ::
In fact, I do not end the backup if RoboCopy fails. I make it return to the first line of the example shown and run through it six times before it is treated as a failure.
- We have not discussed a further refinement, use of the /MT switch. This is how many "threads" of data processing are run in parallel to allow the command to progress quickly [since the computer's capability for data processing far outstrips its disks' ability to supply the data]. The default is 8 threads.
- I start off using 32 threads and halve that at each repeated try until it reaches 1 [which means the disks are setting the limit of data processing speed].
- Only one of my computers ever needs to get down to 1 but having that capability allows me to start the backup then make a pot of Earl Grey and not bother coming back until it is all expected to be over.
***
I've been using ErrorLevel 3 as my decision level with RoboCopy [since WinXP, I think]. In checking the link still worked, I read their article again and I cannot see why I chose that instead of ErrorLevel 2. I just cannot see any logic in my choice.
Denis