Is it possible to start a web site generation with a script? We want a current status of repository every day. That's why that a script should start the generation over night.
It would be nice if somebody could help me.
Solved! Go to Solution.
You can built a script that can do this task and then add this script on the scheduler of Windows
For more information please see the solutions below:
thx for solutions.
Code of the solution: http://community.mega.com/t5/custom/page/page-id/mega-kb-solution?sid=50120000000mqRmAAI
starts to trigger the generation of Websites.
I think i need to start Mega in script before. How can I do that?
By my experience so far:
1. The api is starting MegaApplication process in the background so if you have opened Mega it won't be able to start the process at all.
2. If you have another 'gost' or working Mega processes locking the database the script won't be able to open it
There is not any MegaApplication in background.
Here is the code which I use:
Resolution: Code examples This is the core of the code triggering the web site generation. Trigger web site generation (VB script): 'Get a web site oWebsite Set lWebSites = GetCollection("Web Site") Set oWebSite = lWebSites.Item(1) 'Generate the web site oWebsite oWebSite.GenerateWebSite() Display the list of root objects (VB script tested for MEGA 2005): 'Get a web site oWebsite Set lWebSites=GetCollection("Web Site") Set oWebSite = lWebSite.Item(1) 'Get the collection root objects of the web site oWebsite Set oWebSiteDescription = oWebSite.WebSiteDescription Set lWebSiteScope = oWebSiteDescription.GetRootObjects
but there have to be one or more steps before, that start the MegaApplication. Windows don't know this commands.
If you run ti as a bash script there is a background process mgwapp.exe opening and if you haven't close all other instances on the machine it won't run
Here is example of how you can open connection to the repository
Set oMegaApp = CreateObject ("Mega.Application")
Set oEnvironment = oMegaApp.Environments.Item(myEnvironment)
oEnvironment.CurrentAdministrator = myAdministrator
myEnv.CurrentPassword = myPassword
Set myDatabase = oEnvironment.Databases.Item(myDatabase)
Set oMegaRoot = myDatabase.Open