Save macro content in page and refresh via script

Hi all,

I have created pages based on custom Xwiki classes with macros, that retrieve content from remote sources.
As far as I understand macros are executed at every view of a page. As I’m not aware of the reliability of the remote sources and I know that they are only updated once a day I would like to retrieve the content (via macros), save it to the page and update/refresh the pages via script.

So my questions:
How do I execute a macro only on “edit” or even better a special “update” action and save the result to the page?
How do I update the pages, preferably via shell script, so I can schedule this task?

Thanks in advance.

Hi. A good idea is to use the scheduler. You can google for « xwiki scheduler » to get more info.

Thanks @vmassol: I was not aware of an xwiki scheduler. Are you referring to this application http://extensions.xwiki.org/xwiki/bin/view/Extension/Scheduler%20Application ?

correct

Ok great. I’ll have a look into this.
But this still leaves the question how to save macro content in a page and how to refresh all the pages from the scheduled script. Does anyone have any hints for these topics as well?

Thanks in advance.