Restore-DbaDatabase executing even the bak file is in use #9164
Unanswered
ryanjamesocampo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Guys,
I need you help. I'm my script via scheduler we are executing Restore-DbaDatabase on by request schedule.
So we have some script to back up the database in an hourly period starts at the beginning of the hour and it will take like 20-30mins to execute the back up. (this is working fine)
However, when we execute a Restore-DbaDatabase let's say it falls on the same window time of the backup schedule above that is executed. Then it picks up the latest file, which is still on use(or the job on the back up is not yet done)
Is there a way or syntax to pick up the bak file which is an hour ago? This is to be sure that the file generated was completed and the backup process is done before executing the Restore-DbaDatabase.
Hope you can help me please.
Beta Was this translation helpful? Give feedback.
All reactions