- jobfoldersizes is a python command line tool that utilizes the scandir python module to calculate the folder sizes of a desired root directory. Using scandir can increase the efficency over 2.7.x os.walk methods significantly. jobfoldersizes also adds additional filtering and sorting for your results.
- Version: 1.0
This relies on scandir. Scandir you can install via pip, or download as tar directly from the previous link. It is now included in the Python 3.5 trunk(currently in Alpha).
- Check your system that you have at least Python 2.7.6. This is the minimum version that scandir has been tested on.
- Install scandir either thru pip, manually, or use Python 3.5.x
Python 2.7.x:
pip install -r requirements.txt
- Once installed run the python script
jobsizes.py --root=/path/to/root
and other flags
- --root=/path/to/sort This is required. The path must be accessible and you must have permissions. That may require you run as super user or equivalent.
- --sort=[size|name] How the results should be sorted. The default is size. name sort does a case insensitive sort.
- --filter=regex This allows you to filter the top dirs to be calculated under your root.
- --output=[terminal]|email This sets the output format. The default format is terminal which is present a tabbed tabular format. Email is present simple list for easier rendering across a variety of email platforms.
- -d Will enable debug mode. This will tell you if scandir sees its fast c libraries. It will also output as it calculates each directory before final sorted output. This is helpful is you're not sure if it is rendering or where it is taking long. There is currently no timing.
- Talk to Anthony Scudese