WebPagetest Forums

Full Version: Clearing out old data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What is the recommended way to clear out old test data from a private instance?

I can set up a cron job. Where are the files that should be pruned?

I think this post may be helpful: http://www.webpagetest.org/forums/showth...85#pid8285
The tests are stored in results/YY/MM/DD so you can nuke directories as needed. You can also set up archiving rules in settings.ini and set up cron to run cli/archive.php

At some point I need to add code to prune tests automatically based on available disk spaceas an option.
Hey ovesh - I had a similar requirement and I leveraged the archiving capability + a hack to automatically delete tests older than X days, every day.

Details for this hack are here: http://hostbenchmarker.com/blog/deleting...st-server/
I think with a tiny change to allow for "none" or "/dev/null" as the archive location we could make it work out of the box as well without having to hack the script. Only reason it won't work right now is that it verifies that the archive worked before deleting but we could special-case /dev/null and skip the archiving (probably best to have that logic inside archive.inc proper so it also doesn't try to restore).
Thanks @pmeenan, @ShaneLabs, very helpful!
Reference URL's