Storing and Purging traffic on HDDs

You can look at this script.