weed - archive thinning tool - v1.2
weed is a command line driven tool to thin out archive files which are typically created on a daily basis. It will allow daily files to be held for so many days, weekly files to be held for so many weeks, and so on. The intended outcome is to stop disk consumption growing out of control.
It will thin out (or weed) the files so that you have:
- Annual files at the end of each year (retained indefinitely)
- Quarterly files for 2 years
- Monthly files for 12 months
- Weekly files for 13 weeks
- Daily files for 14 days
Anything not meeting the above criteria is deleted. The timings above are defaults, it's possible to amend them to other values.
Exercise care if you have multiple files on the same backup, e.g. mybackup.tar and myback.json. You must run a weed on each filetype, otherwise the software will just take what is the latest of the two and delete the other.
Please be reminded that weed deletes files and does not make any provision for their recovery.
weed --help
Using the --help flag will give a description of the operation and the different options that can be used.
This is working software and has been in daily use since 2017.
To compile this software, you will need Lazarus 2.x or later. It has been tested on Windows and Linux. As it is only a simple text and file based application, it should be relatively easy to recompile on other hosts which are supported by the Lazarus ecosystem.
Folders are organised as follows:
- root/ - The Lazarus project files, licence and .gitignore
- binaries/ - The main executable file, Linux and Windows are included (both 64 bit)
- units/ - The PASCAL units which make up the core of the software. Most give a description in the header
- None known
Duncan Munro, Duncan Amplification Limited