MS-DOS batch file invocation - command line switches and scheduling


Author
Message
Gork
Gork
Guru
Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)Guru (1.2K reputation)
Group: Forum Members
Posts: 591, Visits: 2.2K
I've posted this before, but I don't even schedule fulls and incrementals on the same day.  I update the Windows Task Schedule entry to run on days 1, 8, 15 and 27 of each month.  I updated the VBS file which created within Reflect to check what day of the month it is when it's executed.  If it's day 1 of the month it runs a full backup, else it runs an incremental.  This is how I've gotten around any possible problems associated with scheduling full and inc/diff at the same time.  And this is why I'm probably not fully aware how Reflect handles these instances.

I too would like to hear from Macrium on this subject.
Nick
Nick
Macrium Representative
Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)
Group: Administrators
Posts: 1.9K, Visits: 10K
Hi 

Apologies for not chiming in earlier on this topic.

To ensure that simultaneous schedules of the same XML file, in an MSDOS, PowerShell or VBScript script, do not run a Full, Diif or Inc at the same time, edit the source code and add the '-g' (GUID) parameter to the end of the reflect command line. Note for MSDOS .bat files this needs to be added to each bat file. For PowerShell or VBScript only one script file is required. 

-g "any unique text"


The '-g' parameter can be any text and is used when multiple backups for the same XML def are scheduled to run at exactly the same time. In this case the following happens:

'Full' backups take precedence over 'Differentials' or 'Incrementals'. 
'Differential' backups take precedence over 'Incrementals'.

Scheduled backups that are 'Trumped' by another scheduled backup configured to run for the same XML file at the same time will intentionally fail with error '0x06 Conflict' in the 'Last Result' column of the 'Scheduled Backups' tab. This processing is handle by 'Reflect.exe' and doesn't use any functionality in 'ReflectService.exe'

Hope this helps

Kind Regards

Nick - Macrium Support

Next Webinar


Edited 24 January 2016 6:33 PM by Nick
Richard V.
Richard V.
Most Valuable Professional
Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)
Group: Forum Members
Posts: 2K, Visits: 8K
Ahah! Thanks, Nick. That explains a lot.  I knew when I said (back on page 2) that "it may be noteworthy that the Windows scheduler entries do also include a {GUID} value as well as the -full, -diff, -inc command line argument" there had to be some task management reason.  This makes their presence in entries based on the same XML task definitions much clearer and quite a neat practical solution if I may say so. Cool

So exactly what does ReflectService.exe do anyhow, if it's not an ULTRA-class trade secret?  The Windows registry name and description for that service remain confused and confusing despite a promise last June that they would be "fixed in a later release".



Regards, Richard V. ("Arvy")
https://forum.macrium.com/uploads/images/afc5d4fe-5d25-4e25-be94-185e.png

Edited 24 January 2016 7:12 PM by Arvy
Nick
Nick
Macrium Representative
Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)
Group: Administrators
Posts: 1.9K, Visits: 10K
Hi Arvy

'ReflectService.exe' actually has several functions dependant on the Edition of Macrium Reflect installed. The only functionality relating to scheduled tasks is to check if there are any missed backups when the service starts. Other functionality relates to Server Plus and SPLA licensing so it isn't appropriate to discuss this within the context of this thread. 

Kind Regards

Nick - Macrium Support

Next Webinar


Richard V.
Richard V.
Most Valuable Professional
Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)
Group: Forum Members
Posts: 2K, Visits: 8K
Right.  Got it.  Thanks.  Still, it would be nice if, whenever someone can get around to it, the registry name and description didn't contradict one another. Smile

Regards, Richard V. ("Arvy")
https://forum.macrium.com/uploads/images/afc5d4fe-5d25-4e25-be94-185e.png

Edited 24 January 2016 8:49 PM by Arvy
Bill R
Bill R
New Member
New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)New Member (26 reputation)
Group: Forum Members
Posts: 18, Visits: 108
Thanks for the info, Nick.   However, when I tried the tests I had used before, I wasn't able to trigger the condition.  They all seemed to complete successfully (with result 0x00), either creating a backup, or indicating that there were no files to be copied, according to the order of invocation.  Using a VBScript, my command line reads
ExitCode = Backup ("""C:\Program Files\Macrium\Reflect\Reflect.exe"" -e -w -g ""test"" <BACKUP_TYPE> ""N:\Backups-Macrium-Test\My Test Backup.xml""")

I also tried it without quotes around "test", and with/without a msgbox preceeding the Backup invocation, to optionally control the order of invocation.  Although you said
 The '-g' parameter can be any text, does it actually have to be the appropriate {GUID}?  Or have I positioned the -g parameter incorrectly?  Or, I'm running the Home Edition of Macrium reflect (6.1). Could it be that this function is not in that edition?
Bill R




Richard V.
Richard V.
Most Valuable Professional
Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)
Group: Forum Members
Posts: 2K, Visits: 8K
The ultimate authoritative answer should come from Nick, of course.  In the meantime, however, you might want to try your scripts' command lines in the same way that Reflect itself adds such simultaneous items to the Windows Task Scheduler when asked to do so based directly on an XML task definition, which is as follows:

C:\Program Files\Macrium\Reflect\reflect.exe -e -w "C:\Users\Username\Documents\Reflect\My Scheduled Backup.xml" -full -g {GUID1}
C:\Program Files\Macrium\Reflect\reflect.exe -e -w "C:\Users\Username\Documents\Reflect\My Scheduled Backup.xml" -diff -g {GUID2}
C:\Program Files\Macrium\Reflect\reflect.exe -e -w "C:\Users\Username\Documents\Reflect\My Scheduled Backup.xml" -inc -g {GUID3}


That scheduled task command format seemed to work in the manner that Nick described it when I tried it.  The {GUID} values seem to be random, but they are placed last (no quotes) following the task definition filename and the -<BACKUP_TYPE> argument and note the space after the -g.  I guess I should have been more specific when mentioning it in my page 2 reply.  Sorry about that.

Macrium should try to automate the -g {GUID} inclusion where appropriate in Reflect's script creation process, but the various script types, task definitions and scheduling templates make it a little more complicated than it may seem at a glance.  Alternatively, they should implement that previous idea of Nick's stated in one of your quoted replies about making the XML task definitions call the scripts rather than vice versa.  I guess that new "super fast" file system change block tracker has taken over top priority. Crying

Regards, Richard V. ("Arvy")
https://forum.macrium.com/uploads/images/afc5d4fe-5d25-4e25-be94-185e.png

Edited 28 January 2016 3:43 AM by Arvy
Nick
Nick
Macrium Representative
Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)
Group: Administrators
Posts: 1.9K, Visits: 10K
Hi Bill 

Thanks for getting back. 

Sincere apologies. On closer inspection the '-g' parameter is only designed to work with XML files scheduled directly on the Windows Tasks Scheduler. (Your command parameters were fine by the way). 

We will update Reflect to handle VBScript, PowerShell and BAT files in the next release, due on Monday. 




Kind Regards

Nick - Macrium Support

Next Webinar


Richard V.
Richard V.
Most Valuable Professional
Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)Most Valuable Professional (4.1K reputation)
Group: Forum Members
Posts: 2K, Visits: 8K
UPDATE:  As promised, the v6.1.1081 release notes include script scheduling improvements as follows: "Concurrent Script scheduling now works in a similar manner to XML file schedules. Scheduling multiple scripts (VBScript or PowerShell) running the same XML file at the same time will now use order of precedence favouring Full over Diff over Inc."

I note, however, that only Reflect's direct XML task scheduler entries follow the -g parameter with a {GUID) value on the command line.  Reflect's script generation (vbs, ps1 and bat) adds the -g parameter to the scripted command line, but without including any {GUID} value.  Is the difference intentional, or is the user required to add some (random) value manually?


Regards, Richard V. ("Arvy")
https://forum.macrium.com/uploads/images/afc5d4fe-5d25-4e25-be94-185e.png

Edited 9 February 2016 7:04 PM by Arvy
Nick
Nick
Macrium Representative
Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)Macrium Representative (3.2K reputation)
Group: Administrators
Posts: 1.9K, Visits: 10K
Hi Arvy

'-g' is actually all that's required to enable exactly the same behaviour as with XML schedules. The XML file name referenced in the Reflect parameters is used as the 'map' to determine whether backup tasks are considered conflicting. 

The GUID that's included after the -g in XML schedules is actually redundant and isn't used in this process. My sincere apologies for my misleading post regarding this. The GUID was originally intended to be used for this purpose but is now superfluous, however, we may use it for future scheduling logic implementations. 

Kind Regards

Nick - Macrium Support

Next Webinar


Edited 9 February 2016 10:16 PM by Nick
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search