Skip to main content

forester

Helpful scripts for the shell. These scripts were created for linux server maintenance, filling small gaps left by the standard tools.

All scripts are written in pure Python and are platform-independent. So you can also use them on Windows or Mac.

PyPI codecov.io

Features

Offers commands to:

  • Summarize the size and latest changes of folders in a directory tree

  • List how much space the subfolders in a directory tree take when considering hardlinks between them

Pure Python. No dependencies - just the standard library.

Usage

forester info

This command gets you an overview of folder contents. It shows the number of files and folders within each subfolder as well as the newest modification time of any file within the subfolder.

$ forester info --max-depth=1 /usr
Scanned 7909 folders

Folder                                                 # Folders        # Files              m_time
----------------------------------------------------------------------------------------------------
src                                                            1              0 2014-02-24 08:35:16
share                                                      2,992         66,927 2019-12-26 23:57:06
local                                                         24             71 2020-01-12 02:22:42
lib32                                                          1              7 2019-11-17 22:11:33
lib                                                        4,126         40,189 2020-01-12 09:53:20
include                                                      757         15,106 2019-12-26 23:55:09
bin                                                            7          2,306 2020-01-12 09:53:20
====================================================================================================
.                                                          7,909        124,608 2020-01-12 09:53:20

forester contribs

This command details out how much space is taken by each subfolder within a specified directory.

$ forester contribs /mnt/backup2/incremental/
Scanned 1115109 inodes
Folder                                        Total size (B)     Size of unique inodes (B)
------------------------------------------------------------------------------------------
2020-01-03                                   549,046,832,496                24,730,165,983
2020-01-04                                   549,142,789,908                24,768,159,392
2020-01-05                                   549,257,074,836                24,823,144,884
2020-01-07                                   549,523,882,623                24,852,989,570
2020-01-06                                   549,359,066,748                24,869,062,127
2020-01-08                                   549,569,521,773                24,898,430,500
2020-01-09                                   549,614,758,102                24,942,556,198
2020-01-10                                   549,651,082,519                24,977,909,521
2020-01-11                                   549,688,306,955                25,014,918,365
2020-01-12                                   549,725,397,716                25,060,355,207
2020-01-01                                   548,898,277,694                25,743,259,501
==========================================================================================
Total                                        799,506,813,350                             -

There are two measures shown for each folder:

  • Total size: This is the total size of all files within the folder as it is also returned by du.

  • Size of unique inodes: This is the size of the inodes which are only linked into this folder. This excludes all files which are also hardlinked to one of the other listed folders. When deleting a folder this is the space which would be gained.

This command was created to measure how much space is taken by each snapshot within a folder with incremental backups created by rsync. Each folder contains hardlinks to the previous backups for unchanged files. With forester contribs one can see how much space is exclusively taken by one of the snapshots.

Installation

Forester is available on Pypi. Therefore installation is as straight forward as:

pip install forester

Contributing

Interested in particular changes? Found a bug? Please read CONTRIBUTING.md for instructions on how to participate.

License

The code in this repository is made available freely and without warranty under the terms of the MIT license (see LICENSE). Feel free to use, change and distribute it.

Metadata

Release files for forester 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forester 0.5.2
File Size Uploaded Provenance
forester-0.5.2.tar.gz 6.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for forester 0.5.2
File Interpreter ABI Platform
forester-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / forester-0.5.2.tar.gz

Download URL forester-0.5.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3145a5b7f6e9de0b81316f8a2f1dadc27780c10c62a520adaf071fc27a36c8fe
BLAKE2b-256 checksum
How to use checksums
c7997d0cc95ca80ce48ec6035779de5e326ee08cc922c88f626abecb32c9f3a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

Release files / forester-0.5.2-py3-none-any.whl

Download URL forester-0.5.2-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf90f5e3b8dd1dd9da708b69c64f9abb078f0a274ef82e1925b2434ebc8d7620
BLAKE2b-256 checksum
How to use checksums
2d1303d550d5fef5621c010797c8479b2dd1b4447bcfc193de433dc216d65137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

Security for forester 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page