rmstale is a tool to remove stale files recursively below a given directory.
Files and folders older than a defined period are removed.
Some examples for use:
- Set on a schedule to clear old files from your temporary directories.
- Set on a schedule to remove downloaded files from your downloads directory.
choco install rmstale
winget install danstis.rmstale
Visit the releases page to find the latest release version.
curl -L -o /tmp/rmstale.tar.gz "https://github.com/danstis/rmstale/releases/download/v1.15.2/rmstale_1.15.2_linux_amd64.tar.gz"
sudo tar -xzf /tmp/rmstale.tar.gz -C /usr/bin rmstale
rm /tmp/rmstale.tar.gz
- From the GitHub releases page download the latest binary for your operating system.
- Place the downloaded file into your desired location.
Flag | Description |
---|---|
-a, --age | Period in days before an item is considered stale |
-d, --dry-run | Runs the process in dry-run mode, no files will be removed. |
-e, --extension | Filter files for a defined file extension |
-p, --path | Path to a folder to process |
-v, --version | Displays the version of rmstale that is currently running |
-y, --confirm | Allows for processing without confirmation prompt, useful for scheduling |
>: rmstale --version
rmstale v1.6.0
>: rmstale --age 14 --path c:\temp
WARNING: Will remove files and folders recursively below 'c:\temp' older than 14 days. Continue?: y
-Removing 'C:\Temp\amc2E40.tmp.LOG1'...
-Removing 'C:\Temp\amc2E40.tmp.LOG2'...
-Removing 'C:\Temp\amc306D.tmp.LOG1'...
-Removing 'C:\Temp\amc306D.tmp.LOG2'...
-Removing 'C:\Temp\amc308D.tmp.LOG1'...
Feedback, Issues, Bugs and Contribution to this tool are welcome.
For Bugs/Issues/Feature requests, please create an issue on the GitHub issues page.
Want to contribute? Great:
- Fork the repo using the Fork button at the top right of the GitHub repo.
- Clone the repo to your development machine, note the dependencies for this project are as follows:
- Go version 1.19 or above
- Create a new branch for the feature that you want to contribute.
- Develop your new feature as you see fit.
- Once you have a working copy of your code, create a pull request against this project.