WebPagetest Forums
Clearing out old data - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: WebPagetest (/forumdisplay.php?fid=7)
+--- Forum: Private Instances (/forumdisplay.php?fid=12)
+--- Thread: Clearing out old data (/showthread.php?tid=13516)



Clearing out old data - ovesh - 01-25-2015 10:29 AM

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/showthread.php?tid=3547&pid=8285#pid8285


RE: Clearing out old data - pmeenan - 01-29-2015 01:08 AM

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.


RE: Clearing out old data - ShaneLabs - 01-29-2015 03:47 AM

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-old-tests-private-webpagetest-server/


RE: Clearing out old data - pmeenan - 01-29-2015 03:55 AM

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).


RE: Clearing out old data - ovesh - 01-29-2015 12:11 PM

Thanks @pmeenan, @ShaneLabs, very helpful!