vugen :: reduce script size

So, we recently upgraded to Loadrunner 12.50. I can’t say that I’m a fan of the new layout and clunky interface, but we will address that in another blog post, as it will take up a lot of space.
What has come to my attention is the ridiculous size of the scripts while you’re editing/building/modifying them. It has become such a concern to us that our current scripts directory is sitting at 19.5GB, and if that’s not ridiculous enough, we’re looking at 226K files. So I write a little script to delete all the unneeded files.
Proceed at your own risk!

So, every time you run a script, it saves a lot of junk that could be useful during that editing session, but after a few compile/crashes/errors, you don’t really need them. You can run this script within the script directory, or at a top level of multiple scripts, or even higher than that. It will recursively delete. It’s easy to follow, its also a bit crude ie. it does not log what it’s deleted. You could modify it to do so quite easily but as I know what’s being blown away, I don’t really need such a feature.
You could also make it prompt you for a directory, and parametrise the path, again, not needed for us as we are just interested in blowing away the junk.

Please be aware, this will delete your recording log, so you wont be able to Re-Generate your script if you proceed – again, not an issue for us.

echo off
forfiles /P "Z:\LR Scripts" /S /M "log" /C "cmd /c echo @path & rmdir /S /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "result*" /C "cmd /c echo @path & rmdir /S /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "data" /C "cmd /c echo @path & rmdir /S /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "log" /C "cmd /c echo @path & rmdir /S /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "*.log" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "*.idx" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "mdrv*.log" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "options.txt" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "*.ci" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "combined_*.c" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "output.txt" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "debug.inf" /C "cmd /c echo @path & del /Q @path"
forfiles /P "Z:\LR Scripts" /S /M "*.bak" /C "cmd /c echo @path & del /Q @path"

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>