how can I get Reflect to automatically do differentials after a full backup (from the command line)


how can I get Reflect to automatically do differentials after a full...
Author
Message
DocDJ
DocDJ
New Member
New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)
Group: Forum Members
Posts: 27, Visits: 50
I just bought Macrium Home 8. I have created a backup schedule with Full + Diff backups. I want to invoke Macrium from a batch file that will automatically decide whether it is time to do a new Full backup or do another Diff in the current set of Diffs.. The command line parameters only allow a value of Full, Diff or Incr with a default of Full if no type is specified.
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)
Group: Forum Members
Posts: 12K, Visits: 72K
I don't understand your note that command line parameters "only" allow specifying a Full, Diff, or Incr. Those are all of the possible types of backups.  So what are you trying to achieve that you can't achieve?  And in your use case, what is the "decision criteria" for whether a Full or Diff should be created?  As long as you can express that in a batch file, you should be able to dynamically set a variable that will then be used as the backup type parameter in the line of your batch file that calls Reflect.

EDIT: If you want to use both a "traditional" schedule AND a batch file, then the right way to do that would be to create scheduled executions of the batch file, not the XML definition file.  To do that, right-click your definition file and choose to have Reflect generate a BAT file for you.  You can use the available options in the wizard or not, but after you click OK, that new batch file will then appear in Reflect under the Scripts tab.  Right-click THAT and select Schedule, and create your desired schedule there.  You can also then customize the batch file further as needed.

Edited 1 April 2022 4:45 PM by jphughan
DocDJ
DocDJ
New Member
New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)
Group: Forum Members
Posts: 27, Visits: 50
jphughan - 1 April 2022 4:43 PM
I don't understand your note that command line parameters "only" allow specifying a Full, Diff, or Incr. Those are all of the possible types of backups.  So what are you trying to achieve that you can't achieve?  And in your use case, what is the "decision criteria" for whether a Full or Diff should be created?  As long as you can express that in a batch file, you should be able to dynamically set a variable that will then be used as the backup type parameter in the line of your batch file that calls Reflect.

EDIT: If you want to use both a "traditional" schedule AND a batch file, then the right way to do that would be to create scheduled executions of the batch file, not the XML definition file.  To do that, right-click your definition file and choose to have Reflect generate a BAT file for you.  You can use the available options in the wizard or not, but after you click OK, that new batch file will then appear in Reflect under the Scripts tab.  Right-click THAT and select Schedule, and create your desired schedule there.  You can also then customize the batch file further as needed.

The purpose of the batch file is NOT to control Macreium, just start it running and let Macrium apply the rules defined in the GUI. The purpose of the batch file is to open a window BEFORE the backup starts and close the window after the backup ends. The window is only to remind me that a backup is still running and to not reboot, shutdown or power off the backup drive. The windows are used by MANY of my programs to be sure I turn the drive on/off at the proper time. The windows are created by a pair of Win32 programs that use a parameter to identify the program using the drive and to identify which window to close (thus allowing multiple programs to run simultaneously on different drives.)
I originally had Macrium free and used the bat file to run Macrium and pop the windows, but now that I have Macrium Home paid-for, I can use Macrium to run the batch files to pop the windows. Either way, the question of which type of run to perform is strictly dependent on what Macrium does and my bat files are independent of the program they work for. And I can use my batch files for anything that needs the switchable drives, by just creating a new parameter value.

Drac144
Drac144
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)Guru (1.2K reputation)
Group: Forum Members
Posts: 891, Visits: 3.2K
Doc DJ,

Correct.  That is what JP is trying to help you do. By creating a scheduled backup within Reflect, a batch file is created which is what is run by the scheduler.  You can then EDIT THAT BATCH FILE and add you commands to open a window before Reflect is run (Reflect is initiated by a command in that batch file) and then close the window after Reflect completes. 
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)
Group: Forum Members
Posts: 12K, Visits: 72K
Ok. If you schedule executions of the batch file within Reflect, then you can create separate Full and Diff schedules, in which case Reflect will pass the appropriate parameter to the batch file at each execution based on which schedule was triggered. And you can still have other customizations within the batch file to do things before and/or after Reflect starts.

If you don’t want to use Reflect to schedule executions of your batch file, then you’ll have to use some other mechanism to specify the appropriate parameter at each execution.

But there’s no way to say, “Call Reflect and have it determine what backup is supposed to run.” You have to TELL Reflect what you want it to do every time you call it. Even if you use Reflect to create schedules, what it does under the hood is essentially create a scheduled task that runs a command line that includes the appropriate backup type parameter based on the type of schedule you created. It doesn’t just “know” what to do if you call it without any parameter.
Edited 1 April 2022 7:03 PM by jphughan
Beardy
Beardy
Expert
Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)
Group: Forum Members
Posts: 637, Visits: 2.4K
I'm certain the outcome of what @DocDJ wants to happen is doable, I'm less certain exactly what it is though...
Getting Reflect to open a command window when the schedule runs a batch is pretty much as simple as having the schedule run it in their own account rather than SYSTEM.. the batch itself can contain logic to determine all sorts of things, opening or closing programs, determining what type of backup to run.. etc. etc. I actually do something similar, soo the batch can determine full diff or inc based off the day of the week & which (Monday) it is in the month.. & have the cmd window show me both progress & exit status of robocopy afterwards.

@DocDJ if we knew in detail rather than vague terms exactly what you wanted to happen, someone could probably suggest how to do it, & probably more easily using powershell than plain batch.. I may be one of the few here who actually prefer the older & more primitive scripting, which can be a royal PITA to get right if you're not familiar with it, more so than the other languages offered.
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)
Group: Forum Members
Posts: 12K, Visits: 72K
My interpretation is that the OP wants to configure a schedule within Reflect that essentially says, “If some external script happens to call you at this particular tine of this particular day of the week, then run a Diff.” But that isn’t how scheduling works. Schedules in Reflect aren’t just a reference for what ti do IF Reflect gets called. They cause Reflect to MAKE something happen at the configured times, which would be entirely independent of a batch file you create — unless again you start with a Reflect-generated template, associate your schedules with that, and then customize it as needed for your purposes.
Beardy
Beardy
Expert
Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)Expert (810 reputation)
Group: Forum Members
Posts: 637, Visits: 2.4K
I was suspecting possibly cart & horse reversed also.. a script might tell Reflect what to do.. but typically not vice-versa.
DocDJ
DocDJ
New Member
New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)New Member (28 reputation)
Group: Forum Members
Posts: 27, Visits: 50
Beardy - 1 April 2022 8:15 PM
I was suspecting possibly cart & horse reversed also.. a script might tell Reflect what to do.. but typically not vice-versa.
@jphughan @Drac144 @Beardy
Let me see if I have this straight. If I create a single Macrium "definition" file with 2 "retention rules" (1 for Full, 1 for Diff), then am I correct in thinking Macrium does not have a method for determining whether to run a Full or Diff by the number of each in the target folder and matching that to my rules? Even though the GUI specifically says, "rules will be applied to all matching backup sets in the destination folder." (That's the way Acronis works, so my mind keeps coming back to that.) Both the GUI and the batch command require ME to specify whether to do a Full or Diff at the time I run Macrium. Of course, as suggested above, since I now have the paid version, I can create 2 separate definitions with the batch files being called by Macrium, but I'm still not clear on how/when/if Macrium decides that I am at the last Diff in my rule count and automatically switch to Full and clean up the Full's & Diff's. 
jphughan
jphughan
Macrium Evangelist
Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)Macrium Evangelist (18K reputation)
Group: Forum Members
Posts: 12K, Visits: 72K
That's mostly correct, and I'll give you examples of why it doesn't work the way you figured.  My own retention policy for my OS backup job specifies to retain 2 Fulls (in case one is corrupt) and 2 weeks' worth of Incrementals.  But that does NOT mean that I want a Full every two weeks.  My schedule in fact creates a new Full only on the first day of each month.  So in my use case, at the END of a given month, I'll have my last two weeks' worth of Incrementals (which I create daily) and then a time gap of no remaining backups until the parent Full, because my setup involves purging some of my daily Incrementals within the current month.  So in my case, it would be entirely incorrect for Reflect to assume based on my retention policy that it should create a new Full after accumulating 2 weeks of Incrementals.

Or here's the opposite example.  Let's say I want to retain 4 weeks of daily Incrementals and therefore specify that as my retention policy, but I want weekly Fulls as a risk mitigation strategy.  Under the way you thought it worked, Reflect would see a 4-week retention policy and assume that I only wanted a Full every 4 weeks, which isn't correct.

So back to your case, merely having a Diff retention policy specifying a certain period of time or a certain quantity of Diffs doesn't necessarily mean that when that limit is reached, it's time to create a new Full. It could just mean you want to start purging older Diffs.  Or for that matter it doesn't necessarily mean that Reflect should have waited that LONG to create a new Full.  Maybe you want to split your total Diffs across multiple Fulls.  (That's another thing to be aware of.  The Diff and Incremental retention policies are TOTAL figures, not per-Full figures.  And that design also enables use cases that wouldn't otherwise be possible, such as retaining 6 weeks of Incrementals across two monthly Fulls rather than requiring each Full to have the same time period or quantity of Incrementals.)

Lastly, I'll also point out that the retention policies are optional.  You can uncheck any or all of the checkboxes beside the Full/Diff/Inc rows.  Some people do that because they prefer manual purging.  And in that case, you would certainly have to tell Reflect what sort of backup you want at any given time.

And that is why as I said earlier, retention policies govern the purging of existing backups, not the creation of new ones.  Reflect will not make any assumptions on the type of backup you want based on your retention policy and your existing backups, because those data points won't be sufficient to make correct assumptions for everyone's use case.

The reason I said "mostly correct" earlier is that you don't need a separate definition file to run Differential backups.  Just call the same definition file but specify "Diff" as the parameter.  If you'd be able to set up a solution wherein your batch file called one of two completely different batch files, I'm not sure why you wouldn't be able to set it up such that it tweaked a parameter instead.

Edited 2 April 2022 3:22 PM by jphughan
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