2013-10-23 05:16 AM - edited 2015-12-18 12:28 AM
I am new to SnapCreator. Currently, I am trying to implement a daily scheduled task that clones the production Postgresql database into a DEV-Testing server.
Additionally, In prior of overwriting the mounted clonevol, the task should trigger a script that check whether there are other "in-development" databases running on the DEV-Testing Server and exports these to a temporary location, in order that we can import these DBs into the newly created and mounted clonevol again.
So far I am able to create a 1:1 clone without any issue. However, I am having following issues:
- Export of "in-development" databases. This step is triggered by a "POST_CLONE_CREATE_CMD=CLONETARGET:" command, which triggers a bash script on the DEV-Testing Server to do the magic. Since this task takes some times to complete, i am facing the problem that the SnapCreator Scheduled task continues without waiting for the exit 0 from the bash script. Is there any parameter of settings that i can use to increase the timeout? or force the POST_CLONE_CREATE_CMD to wait for the completion of the bash script?
- Cleaning up of previous clonevols and nfs exportsfs entry. Is there any possibility that i can do this with in the scheduled task? of dynamic variable like %SNAP_TIME that i can use?
Thank you in advanced
Solved! SEE THE SOLUTION
2013-10-23 12:15 PM
In Windows, I have done a similar procedure using below syntax.
cmd /C start /wait <somebatchfile>
This basically puts the process to wait.
In your case, using exec or similar command might help. (but the problem with exec is, it forks subprocess without any variables shared between the shell environment).
The easiest option is to use below. (find how long your magic script takes, and insert that as a sleep command, this makes Snap Creator to wait)
POST_CLONE_CREATE_CMD02=CLONETARGET: sleep 120
Please let me know if this helps.
2013-10-24 08:19 AM
Thanks for your prompt reply.
Finally, i just worked around this issue by just executing one CMD command. and doing all the magics in the script on the Agent. Since the task running time is random, i do not think the Sleep Command will help in my case.
In regards, of deleting CloneVols and Exportfs entrys created by the previous Clone Task. I just realized that there is a option "NTAP_CLONE_FOR_BACKUP=N", which suppose to do the trick. however, it does not.
Thanks a lot
2013-10-25 04:53 AM
I figured the solution by my own. In order to clean up the previous created CloneVols and Exportfs entries with SnapCreator. You will have to define an alias/reference with "NTAP_CLONE_IGROUP_MAP" to map the created Clones to this Alias.