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
Beardy
Beardy
Expert
Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)
Group: Forum Members
Posts: 640, Visits: 2.4K
@Beardy I understand the scheduling operation and I think I may be stuck with creating Windows-scheduled programs which call Macrium via command-line and tell it what kind of backup to do. HOWEVER, I don't think that batch files will solve my problem of getting my pre-and post window dialogs to show up at the right times. Yes, I can handle the pre-backup popup in the batch file that STARTS Macrium, but in order to create the POST- backup window, that batch file must remain on my screen until the backup is finished and Macrium exits. (As a  test, I created a shortcut to my PRE- bat file and set it to run "minimized". But doing that prevented it from displaying my prompt message to turn on the drive.) I will try a real WiIn32 program instead of a BAT or CMD file and have it prompt for and test for the drive to come on line, then have it call Macrium, then prompt me to turn off the drive and close the already open reminder window. That will make it all one program (not just a batch file). Since the two programs to prompt me are already Win32, I can merge them. That's a LOT more work to help me dump Acronis, but may be worth it.

I'm still struggling to see the issue I run Reflect from a batch file, that batch file does things both before and after Reflect runs, if I create or have reflect generate the batch, add such actions as I need before and after the backup.. Momentarily forget Reflect exists (even though the batch runs it) and use Windows task scheduler to create a task to run that batch job as Myself only when I'm logged in, when it runs, it opens a command window with which I can interact, (and for testing purposes I have had PAUSE and even CHOICE in there in a couple of places so I had to hit a key to continue)...  Actual command window pre & post backup dialogues if you will (do you actually need a dialogue that's external to the batch job even?).
The reflect window not showing is no never mind.. reflect puts enough in standard out you can see the progress in the command window..
You can see & interact with any program you have the batch run before or after the backup..
Or at least I can here.
For the life of me I can't begin to see why you need two batch files.. one generated by reflect but scheduled by you as you doesn't exit till everything you have happen after the backup completes, it doesn't even move on to the next command in sequence till the last completes, unless that's an external program which you've started by "Start program.exe" rather than running it in the normal way for a batch file... if you simply put notepad.exe in there notepad will open & the batch will wait till you close notepad before continuing or whatever other program you need to manipulate shares or connect a drive, or whatever.. you can even make following actions contingent on the exit status of that program..

The only catch I can see is if your personal account lacks admin, because reflect will need the run with highest privileges checkbox set in the scheduler (I think, I've not tried without or from a limited account).

I must be missing something pretty basic here because I'm not seeing an issue that can't be overcome or worked around fairly easily.
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
Beardy - 4 April 2022 7:18 PM
The only catch I can see is if your personal account lacks admin, because reflect will need the run with highest privileges checkbox set in the scheduler (I think, I've not tried without or from a limited account).

I don't think that's correct in this case.  Reflect is capable of prompting for elevation if it wasn't invoked from an elevated context, and if the scheduled task is designed to run in a way that will allow interaction, then it would be possible to respond to that UAC prompt rather than needing to make sure Reflect runs "pre-elevated" as would be necessary for appropriate background execution.  Whether anything ELSE in the batch file might require execution from a context that's already elevated is of course a separate question.

Beardy
Beardy
Expert
Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)
Group: Forum Members
Posts: 640, Visits: 2.4K
@jphughan You're probably correct, I did qualify that by saying I'd not tried it...

@DocDJ  I'm clearly missing something.. Sometimes it's easier to approach helping set up Reflect knowing exactly what the ultimate goal is, someone stating:
I'd like X to happen, followed by a backup, followed by Y & this sequence of backups... Different people might come up with various approaches, & some might prove easy..
On the other hand, trying to troubleshoot a specific snag a user hits, while trying to set up a certain approach can sometimes muddy the waters, particularly as it can result in suggestions which might solve that bit while breaking the ultimate aim.

I'd probably do better if I understood clearly what your aim is.. Maybe I'm just being a bit slow today.. it wouldn't be the first time. But we appear to be trying to solve two issues at once, what type of backup, & how to prompt for something unrelated to that, & I'm afraid at the moment I can't see the wood for the trees.
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 - 4 April 2022 8:00 PM
@jphughan You're probably correct, I did qualify that by saying I'd not tried it...

@DocDJ  I'm clearly missing something.. Sometimes it's easier to approach helping set up Reflect knowing exactly what the ultimate goal is, someone stating:
I'd like X to happen, followed by a backup, followed by Y & this sequence of backups... Different people might come up with various approaches, & some might prove easy..
On the other hand, trying to troubleshoot a specific snag a user hits, while trying to set up a certain approach can sometimes muddy the waters, particularly as it can result in suggestions which might solve that bit while breaking the ultimate aim.

I'd probably do better if I understood clearly what your aim is.. Maybe I'm just being a bit slow today.. it wouldn't be the first time. But we appear to be trying to solve two issues at once, what type of backup, & how to prompt for something unrelated to that, & I'm afraid at the moment I can't see the wood for the trees.

Thanks to all of you for your really valuable comments. Please let me try to explain in more detail what I want to happen. Fr script, below, read "batch file" (.BAT, .CMD, .VBS or .PS1), NOT a Macrium script, unless I say it is.
1. a scheduler (probably Windows' scheduler, from what I've learned here) starts a script, passing it a parameter (e.g.; Full)
2. the script prompts me (via whatever mechanism - a window, msgbox, etc -is available) to turn on the switch for the drive
3. the script tests (in a loop) for the drive to come online (I have a 5TB drive that takes about 30 sec's to become ready)
4. the script issues the Windows "start" command WITHOUT the "WAIT" option which causes a small window to popup that says "backup running, don't close this window". The purpose is to remind me not to reboot, not to turn off the drive, or do anything else that may interfere with the backup. This window stays onscreen until later but I want the SCRIPT window to disappear).
5. the script starts Macrium using the Windows "WAIT" option of the start command. The backup runs and my script is waiting for it to finish.
6. now the script pops up another window where the program running it tells me to turn off the switch, then loops until the drive is no longer online
7. the new window says "the backup is done.Close me." When I click, it tells Windows to locate the other window by its Window class and Window name,  then the script tells THAT window to close, then closes itself.. The Window class and name were defined by me (when I wrote those 2 popup programs). 

I could probably do all this with ONE program having the 2 popup windows. I tried to get Macrium to run these 2 programs as part of my before/after scripts, but the windows never appear (because Macrium runs in its own context, which is therefore forbidden (by Windows) to interact with my login session)

I would LIKE the script window not to be visible, but I've tried to get that to work and not had success. So I might need an actual program instead of a script, because a program does not have to have a window unless it pops one to communicate (or uses a msgbox).. 
PS. I have been using this technique in Acronis with before/after batch files to do it and it has kept me happy for a year. Now I want to do the EQUIVALENT with Macrium.
I hope this clears up what I'm trying to do. I have the individual pieces working. I just need to find the best way to combine them to do it with Macrium. I'm currently doing it with batch files and WIn32 .exe programs. As I said, I might need to do it all with a single large Win32 program.
.
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 can't speak to how Acronis works since I haven't used it in a long time, and judging by the fact that they're now rebranded their imaging product as a cyber protection suite with forcibly installed and not entirely defeatable general purpose malware protection, I have no intention of touching it.  But you've got the right idea.  If you were using PowerShell, you would be able to control the visibility of the script window.  The scheduled task can be configured to run an instance of PowerShell that provides parameters for calling the script file, specifying the backup type, and hiding its own window.  But I haven't looked into how to achieve that when using batch files.

Beardy
Beardy
Expert
Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)Expert (813 reputation)
Group: Forum Members
Posts: 640, Visits: 2.4K
I wouldn't try hiding a batch window, you get some very odd behaviour & some most strange exit codes, can possibly be done, but if PS has means to hide itself it'd be the way to go, that or VBS, or something similar like autoscript, which runs in the system-tray unless you've got it popping up a window or message.

The basic functionality could be done in a batch, & it could have run minimised until Microsoft ripped NET SEND out of windows for the messages, then also deprecated or removed (unsure which) the message function they replaced it with...  now if I were trying with a batch I'd probably just have the command window open & interact with it directly.

I'd probably use AutoScript, or learn enough powershell to get the job done with the requirement for being unobtrusive though.

You might get a batch to work, but you'd need to schedule it (outside of Reflect) to run as yourself, the Windows scheduler can certainly run a batch within a given user's session, with which it can then interact, but it's awkward making it even run minimised (in that Microsoft's documented method to do so doesn't actually work, & it runs in an open window you have to manually minimise regardless), much less hidden.
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 - 4 April 2022 11:57 PM
I can't speak to how Acronis works since I haven't used it in a long time, and judging by the fact that they're now rebranded their imaging product as a cyber protection suite with forcibly installed and not entirely defeatable general purpose malware protection, I have no intention of touching it.  But you've got the right idea.  If you were using PowerShell, you would be able to control the visibility of the script window.  The scheduled task can be configured to run an instance of PowerShell that provides parameters for calling the script file, specifying the backup type, and hiding its own window.  But I haven't looked into how to achieve that when using batch files.

I'll have a look at PS, thanks.
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 - 5 April 2022 2:34 AM
I wouldn't try hiding a batch window, you get some very odd behaviour & some most strange exit codes, can possibly be done, but if PS has means to hide itself it'd be the way to go, that or VBS, or something similar like autoscript, which runs in the system-tray unless you've got it popping up a window or message.

The basic functionality could be done in a batch, & it could have run minimised until Microsoft ripped NET SEND out of windows for the messages, then also deprecated or removed (unsure which) the message function they replaced it with...  now if I were trying with a batch I'd probably just have the command window open & interact with it directly.

I'd probably use AutoScript, or learn enough powershell to get the job done with the requirement for being unobtrusive though.

You might get a batch to work, but you'd need to schedule it (outside of Reflect) to run as yourself, the Windows scheduler can certainly run a batch within a given user's session, with which it can then interact, but it's awkward making it even run minimised (in that Microsoft's documented method to do so doesn't actually work, & it runs in an open window you have to manually minimise regardless), much less hidden.

yes, batch is painful. The biggest problem with it is how to get the post-backup one to run and interact when the backup is done. My scenario seems to require one big batch file or program running in the background. And making a batch invisible seems to be a losing proposition. All these problems seems to be driving me toward Power Shell (as suggested by @Beardy or a Win32 program.scheduled outside of Macrium.
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