<div dir="ltr">You might want to also regex-search all notecard text for embedded UUIDs that match any assets.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 12, 2013 at 6:34 PM, Melanie <span dir="ltr"><<a href="mailto:melanie@t-data.com" target="_blank">melanie@t-data.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
this requires a sweep and mark approach.<br>
<br>
Create a table that parallels your asset table. It should contain<br>
the asset ID and a date field which would default to the asset's<br>
creation date.<br>
<br>
Next you need to iterate over all rezzed objects in all sims and<br>
collect the UUID of any used textures and the UUIDs of all inventory<br>
items. Keep those that refer to objects separately, as well as those<br>
that refer to scripts and wearables. Also make a list of all<br>
notecards. Don't forget to include ground textures and parcel<br>
textures. Mark all textures and wearables with the current date.<br>
<br>
Then, similarly iterate all user inventories. Mark all UUIDs of<br>
simple objects like wearables and textures, then add the UUIDs of<br>
the objects, wearables, notecards and scripts to the UUID lists<br>
created in the first step. Mark all "simple" (non-object) assets<br>
with the current date.<br>
<br>
Next, iterate all notecards. Extract all attached (embedded) objects<br>
and add the wearables and objects and other notecards to the lists<br>
above. Mark all simple assets found. Repeat until no more notecards<br>
are left.<br>
<br>
Finally, iterate all object assets, retrieving and parsing them to<br>
glean the same info as you obtained from the sim. Mark textures and<br>
wearables and also add wearables, objects and scripts to the above<br>
lists. Mark all object assets with the current date.<br>
<br>
Repeat until no more objects are left in the object list.<br>
<br>
If notecards were collected, go back to iterating the notecards.<br>
<br>
Last, iterate wearables (extract texture ids and mark them) and<br>
scripts (regex-match UUID-like things and if they are a known asset,<br>
mark them).<br>
<br>
Depending on the grid size, this should leave you anywhere from a<br>
few days to a few months on. Assuming the sweep & mark took less<br>
than 6 months, all UUID in the secondary table that have a date<br>
stamp OLDER than 6 months are unreferenced and the assets they name<br>
can be deleted.<br>
<br>
Since old assets are static, limiting future scans to only look at<br>
things changed after the last scan was done will allow you to keep<br>
this dated list and use it for further purging, dramatically<br>
shortening the next sweeping run.<br>
<br>
A lot of this code is present in the flotsam cache and the<br>
archivers. It's a matter of putting it together properly and filling<br>
in a few tricky spots.<br>
<span class="HOEnZb"><font color="#888888"><br>
Melanie<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 13/04/2013 02:40, Jeff Kelley wrote:<br>
> At 4:20 PM -0500 4/12/13, Chris wrote:<br>
><br>
>> As far as I can tell it does also pick up assets recursively although how<br>
>> deeply nested I am unsure of; I have not tested more than a few objects deep.<br>
><br>
> Well, there is no recursivity, strictly speaking. "Nested" is more<br>
> accurate. An object in itself is stramlined in the XML (not a<br>
> reference pointing to self). Recursivity is achieved in-world with<br>
> the "rez and give a copy of self" trick.<br>
><br>
> I'm searching a way to clean the database more deeply than with SQL queries.<br>
> That implies parsing SceneObjectGroups, as well as the binary UUIDs<br>
> in primShapes:Texture. Not a simple task.<br>
><br>
><br>
> -- Jeff<br>
> _______________________________________________<br>
> Opensim-users mailing list<br>
> <a href="mailto:Opensim-users@lists.berlios.de">Opensim-users@lists.berlios.de</a><br>
> <a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
><br>
><br>
_______________________________________________<br>
Opensim-users mailing list<br>
<a href="mailto:Opensim-users@lists.berlios.de">Opensim-users@lists.berlios.de</a><br>
<a href="https://lists.berlios.de/mailman/listinfo/opensim-users" target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-users</a><br>
</div></div></blockquote></div><br></div>