Aller au contenu principal

Running script regardless of backup success

Thread needs solution

I currently have a batch file running when my TIH 2014 backup succeeds. Is it possible to have that batch file run regardless of whether the backup succeeds or fails?

0 Users found this helpful

I think you could do this if it was a pre-command as it could be launched before the backup, but may not be ideal if you need the backup to run (or at least try to run) before your script is launched.  If the backup failed though, then it doesn't seem like it's that important that it run after the backup, so that's why a pre-script might still be useful.  

What's the script do and does it have to be run right after the backup?  If not, you could just launch it as a Windows scheduled task, at a set time that is meant to occur after the backup would normally run.

It conditionally shuts down the computer. So it can't run before the backup. Instead of just guessing at a time when the backup is done, though, I'd like it to always run when the backup completes. Can TIH do that?

If the backup runs, then yes, the script would launch.  The questions would be why is the backup failing, or not running?  As long as it does, then your post command should kick off just fine. I haven't used 2014 in ages so can't remember if it was an available configuration, but this option is built directly into current versions as well.

 

It fails when I change my Windows password but forget to update the TIH scheduled job with the new password. Is there a way to prevent that from happening?

I want to use the script instead of the built in functionality (which 2014 does have) because my script is more sophisticated and has some logic built-in.

If the option is not in 2014, use a post command and open notepad

@echo off
shutdown /s /t 30
exit

change /t 30 to a shorter or longer time period (this is 30 seconds in case you need to manually abort you have some time to do a shutdown /a).

or to shutdown immediately

@echo off
shutdown /p /f
exit

save as shutdown.bat and then point the post command to the script.

Eliezer Broder wrote:

It fails when I change my Windows password but forget to update the TIH scheduled job with the new password. Is there a way to prevent that from happening?

I want to use the script instead of the built in functionality (which 2014 does have) because my script is more sophisticated and has some logic built-in.

I'm not sure about 2014.  In 2019, the backup script runs with the logged on admin account.  Normally, if you change the password for the user account, you should log out of the account and log back in with it so that Acronis launches with the new password when it runs.

...So back to my original question: can TIH run my batch file regardless of the backup's success or failure? 

My understanding is that if the backup does not run or fails, the post command will not apply.  Hence, my recommendation to run the script as a scheduled task.  Although this may be a guess, if you want the machine to be off after hours, run it as as scheduled task at a set time.

That way, if the backup runs, then the post script will too and it will shutdown.

If the backup doesn't run, then the scheduled task can still run at a reasonable after hours time and shutdown the computer anyway.