Automated size growth reports
Question / Problem
We would like to automate a report that shows the size growth since the last scan.
Is it possible to schedule a comparison, using a saved scan (XML)?
Answer / Solution
TreeSize is basically designed to visualize the current state of your storage, but it can also compare these results with previously exported ones to calculate the changes inbetween.
Starting with v9.0, you can use exports to the SQLite format for this. You can configure the task in the task scheduler, or run it from a command line. E.g. if you want to scan D:, compare it with an older scan, export the results of the comparison to HTML, and update the older scan, you could just call:
START /WAIT "TreeSize" Treesize.exe /COMPARE C:\Scan_D.SQLite /SQLITE "C:\Scan_D.SQLite" /HTML C:\Compared_D.html D:\
If you want to compare information on folder level only, you can also use the XML format. Doing so requires several steps though, combined in a batch script:
- Perform the scan of the path and export the scan to an XML file using the /XML command line parameter.
- Perform a compare of the scan from the step before with a previous one, using the command line parameter /COMPARE and export the results in an appropriate format
- Replace the XML file that represents an older scan with the current one, so that it can be used for the next run.
A batch file for drive D:\ could look like this:
START /WAIT "TreeSize" TreeSize.exe /XML "C:\New_D.xml" D:\
START /WAIT "TreeSize" TreeSize.exe /OPEN "C:\New_D.xml" /COMPARE "C:\Old_D.xml" /HTML "C:\Compared_D.html"
DEL "C:\Old_D.xml"
MOVE "C:\New_D.xml" "C:\Old_D.xml"
Our disk space manager SpaceObServer offers features like this out-of-the box, as it stores historic disk space data in a SQL database.