[Moin-user] revision file deletion script developement
tw-public at gmx.de
Thu Apr 6 05:45:02 EDT 2006
> I've seen in the mailing list that there is no wikiconfig parameter to
> limit the number of revision pages, but that a small scrip may do
If you talk of "reduce-wiki": it is not intended for that usage.
The main (and maybe currently only) usage is to flatten the content of
moinmaster wiki to later distribute it as underlay directory.
> I would like to develop this script but don't know moinmoin in detail.
For such stuff, there isn't much code anyway. Have a look at reduce-wiki
script (see MoinMoin/scripts/... for 1.5.2). Even better: wait until
1.5.3, all script stuff is much more consistent and nicer there and
driven by a single "moin" command.
1.5.3 is expected really soon.
> Can I develop a small perl scrip which delete the content of each
> "revision" directory (based on date for example. older than xxxx) of
> each moinmoin page without impacting the consistency of moimoin
Perl code can't go into main tree. Maybe have a look at python (and the
reduce script) so you can reuse our and we can reuse your code. If you
don't want to code in Python (pity), you could also write a perl script
and put it on some market page on MoinMoin site.
I could imagine giving a --count=100 parameter to reduce script to keep
the last 100 revisions of a page. Or a --older=365 to keep a year of data.
You need to work on following things:
* PageDir/revisions/* (the content files)
* you don't need to touch "current" file
* PageDir/edit-log has entries for those "old" revisions
* data_dir/edit-log is the global edit log
There could also be an option not to delete the old revisions, but to
zip them (saving almost as much space as deleting):
* 00000000.zip == contains revisions 1 .. 99
* 00000100.zip == contains revisions 100 .. 199
* (the latest 100 revisions should not be zipped)
More information about the Moin-user