Profile Cleanup
Posted: Mon Jul 18, 2011 1:23 pm
Vadi asked me to write a Lua function that automatically deletes old profiles/maps, to reduce the pile of snapshots that build up over time. I'm posting the package consisting of a function and an alias here instead of the "Scripts & Packages" forum, because it's still meant for testing. Particularly, to learn whether it works fine on all operating systems, profile names, etc. and whether its functionality is what you people truly want.
This function requires the LFS (Lua file system) library, which should be contained in newer Mudlet versions (but I'm not sure off-hand since when).
Simply call the alias with: "delete old profiles/maps" to delete either old profiles or old maps. An optional further argument will specify a number of days: Files newer than so many days back will NOT be deleted. By default this is set to 31. Furthermore, the function will always keep a single profile/map of any month prior to the current one.
Examples:
"delete old profiles" -> deletes profiles older than 31 days, excepting one profile each for months before that.
"delete old maps 10" -> deletes maps older than 10 days, excepting one profile each for months before that.
I'm looking forward to any feedback.
This function requires the LFS (Lua file system) library, which should be contained in newer Mudlet versions (but I'm not sure off-hand since when).
Simply call the alias with: "delete old profiles/maps" to delete either old profiles or old maps. An optional further argument will specify a number of days: Files newer than so many days back will NOT be deleted. By default this is set to 31. Furthermore, the function will always keep a single profile/map of any month prior to the current one.
Examples:
"delete old profiles" -> deletes profiles older than 31 days, excepting one profile each for months before that.
"delete old maps 10" -> deletes maps older than 10 days, excepting one profile each for months before that.
I'm looking forward to any feedback.