This script collects the size of each Site Collection in a SharePoint farm. The values are written in a text file and are sorted in a descending order by Site Collection size. You may easily specify a different file path ($OutputPath) or file name ($OutputFileName) by modifying the corresponding variables.

Create a Windows Task Scheduler job on one of your SharePoint servers to readout the Site Collection sizes on a regular basis. You may change the retention time by changing the $RetentionTimeDays variable. The default value is 14 days.