cancel
Showing results for 
Search instead for 
Did you mean: 

Post recoverypoint creation script has strange issue and doesnt work fine

alirz
Level 3

im running the trial version of SSR 2013 R2 on windows 10.

I created a small .bat script that simply puts the computer to sleep. I set SSR to run this script after recvoverypoint is created.

My SSR creates the backup on a NAS drive. The issue is that it seems that once the recoverypoint is completed, SSR needs a few more seconds before it can finalize/close the backup file it was writing. But as it is, SSR calls the script before its done writing the backup file. hence, the NAS ends up having an incomplete backup file with a .tmp extension.

I updated my .bat script to have a timer so that when ran, it gives a timer of 60 sec before the next command is executed to put the computer in standy by. This script runs fine if ran by itself (double clicking on it). However when the SSR calls this script, the computer goes to sleep instantly, the timer part doesnt run for some off reason. I tried increasing the timeout setting for the script in the SSR settings but that didnt help.

Any ideas why this is happening?

 

here is my batch script:

TIMEOUT /T 60 /NOBREAK
C:\Windows\swoff.exe -e

 

19 REPLIES 19

Markus_Koestler
Moderator
Moderator
   VIP   

Do you run it as as post oder after script?

alirz
Level 3

@Mark

not sure what you are asking when you say " post Oder"?

i configured the script in the "commands" setting on my backup task. There are thre commands you can do for a backup if I recall. I'm setting  the script in the post recovery point creation

.

thanks

Markus_Koestler
Moderator
Moderator
   VIP   

Sorry "oder" means or in German ;)

Hm, try this one:

start /w TIMEOUT /T 60 /NOBREAK

alirz
Level 3

@ Mark

 

Thanks but that did not help. The computer still goes to sleep instantly when SSR calls that script.This is really strange.

Anyways heres the error i see on the screen when i wake up the computer from standby.

Note that in the settings of the backup, the timout value for the script is set to the defautl of 60 seconds.

 

ssr_error.PNG

 

 

ssr2.PNG

alirz
Level 3

UPDATE.

Upon further looking it seems that the script is indeed run with the correct TIMEOUT / PAUSE function. However, it looks like that SSR waits for this script to complete before finishes writing the backup V2i file. While the script is running, SSR displays:

ssr_running_script.PNG

 

In the screen shot you can see that it says "running external program" While this is happening, the backup file still has not been finalized and it has a .tmp extension. So once the computer sleep command kicks in from the script, SSR doesnt get a change to finalize the backup file name to .V2i hence the backup file is not complete.

Any idea?

Markus_Koestler
Moderator
Moderator
   VIP   

Have you increased the timeout for the job yet?

alirz
Level 3

Increasing the timeout in SSR backup job settings has no affect.

Markus_Koestler
Moderator
Moderator
   VIP   

Maybe swoff.exe is blocking the batchfile. Try this script and increase the timeout to a value greater then 60 seconds.

 

start /w TIMEOUT /T 60 /NOBREAK
start C:\Windows\swoff.exe -e

alirz
Level 3

Well if I run my script by itself it functions fine. Swoff.exe triggers after the 60 seconds . But when SSR calls the script, as I mentioned, the timer still seems to to work however SSR doesn't finish writing the backup file until the script and completed. By that time the computer has gone in standby and it's too late for SSR to complete the back file. This's a flaw in SSR script running no mechanism.

thanks for your help.

criley
Moderator
Moderator
Employee Accredited

This is something that I can test here.

I'm not familiar with swoff.exe - where can I get a copy of this to test with?

alirz
Level 3

@Chris

Here you go. Thanks

http://external.informer.com/airytec.com/en%2Fswitch-off

 

criley
Moderator
Moderator
Employee Accredited

I see similar results here and the behaviour does not seem right to me.

I have raised this internally so I will keep you posted with the feedback I receive. I'll be out of office for a few days after today so I may not get back to you until later next week.

alirz
Level 3

@Chris

 

Thanks.

Roland_R_
Level 2
Partner

Here is a workaround using Windows Scripting Host.

E:\xtest\xsleep.cmd       -> Batch file for SSR, start xsleep1.vbs

E:\xtest\xlsleep1.vbs     -> Start xsleep2.vbs as separate instance in Background. So the control go back to the cmd file and the cmd file can finish.

E:\xtest\xsleep2.vbs       -> Create a pause for SSR to finish the SSR job and start swoff.exe -e

E:\xtest\swoff.exe          -> Portable version of swoff.exe

 

1. xsleep.cmd

E:\xtest\xsleep1.vbs

2. xsleep1.vbs

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

'Start in Background
WshShell.Run "wscript.exe E:\xtest\xsleep2.vbs" , 0

3. xsleep2.vbs

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")

wscript.sleep(60000) ' pause 60 seconds to give SSR time to finish the job


WshShell.Run "E:\xtest\swoff.exe -e" , 0

---------------

Hope this helps.

 

 

alirz
Level 3

Thanks. That looks a bit too much work for what i had in mind. I'm sure it work :)

For now, what i've done as a work around is setup a scheduled task, which executes 30 min after the computer wakes up from sleep to do a SSR backup. The SSR backup only takes about 20 min to complete so theres a buffer of 10 min and then the computer goes back to sleep.

Markus_Koestler
Moderator
Moderator
   VIP   

In case everything works fine now, may I ask you to mark this post as solved?

criley
Moderator
Moderator
Employee Accredited

Markus,

This is not fixed (not from my point of view anyway).

I have raised this internally and am still waiting on a final decision on this. It looks like something in the code is not working correctly..... but am still waiting on our engineering team to confirm. I will update here once I get a definitive answer.

Markus_Koestler
Moderator
Moderator
   VIP   

Perfect, thanks Chris. I wasn't aware of this.

Markus_Koestler
Moderator
Moderator
   VIP   

Chris, any updates here?