ChronoClean is a fast, efficient, and safe file cleanup utility written in Rust that helps you automatically remove old files based on their timestamps while protecting important data.
- 🕒 Delete files based on their age (created, modified, or accessed time)
- 📁 Support for multiple target folders
- 🛡️ Ignore specific files and folders to protect important data
- 🌲 Configurable directory traversal depth
- 🗑️ Moves files to trash instead of permanent deletion
- 📝 Dry run mode to preview what would be deleted
- 🧹 Optional cleanup of empty folders
- 🔗 Optional symbolic link following
ChronoClean is available for Windows, Linux, and MacOS.
Get the latest version here. Want an older version? Check all releases here.
chronoclean --delete-before <TIME> --target-folders <PATHS> [OPTIONS]
-d, --delete-before <TIME>
: Delete files older than this time (e.g., "30d", "24h", "1w", or combined like "3d 5h")-t, --target-folders <PATHS>
: Comma-separated list of folders to clean up
--file-date-types <TYPES>
: Specify which timestamps to check. You can use the full names (created, modified, accessed) or their first letters (c, m, a). [default: created,modified]--ignored-paths <PATHS>
: Comma-separated list of files/folders to ignore--min-depth <DEPTH>
: Minimum directory depth to search [default: 0]--max-depth <DEPTH>
: Maximum directory depth to search [default: infinite]--delete-empty-folders
: Delete empty folders after file cleanup [default: false]--follow-symbolic-links
: Follow symbolic links while traversing [default: false]--dry-run
: Preview what would be deleted without actually deleting [default: false]
The time format for --delete-before
supports various human-readable formats:
1s
,1sec
- 1 second2m
,2min
- 2 minutes3h
,3hr
- 3 hours4d
,4days
- 4 days5w
,5week
- 5 weeks6M
,6month
- 6 months7y
,7year
- 7 years
You can also combine them: 1y6M
(1 year and 6 months), 2w3d
(2 weeks and 3 days), etc.
chronoclean --delete-before 30d --target-folders "C:/Users/User/Downloads"
chronoclean --delete-before 1w --target-folders "C:/Users/User/Downloads","C:/Users/User/Documents" --ignored-paths "C:/Users/User/Downloads/Keep","C:/Users/User/Documents/Important"
chronoclean --delete-before 24h --target-folders "C:/Users/User/Downloads" --dry-run
chronoclean --delete-before 7d --target-folders "C:/Users/User/Downloads","C:/Users/User/Temp" --delete-empty-folders
chronoclean --delete-before 30d --target-folders "C:/Users/User/Downloads" --file-date-types "modified,accessed"
- Files are moved to the system trash instead of permanent deletion
- Dry run mode to preview changes
- Ignored paths to protect important data
- Validation of all paths before operation
- Detailed logging of all actions
- Install Rust.
- Build the binary by executing this command, the compiled file will be in the
target/[debug|release]
folder.
# For development build
cargo build
# For release (optimized) build
cargo build --release
Contributions are welcome! Please feel free to submit a Pull Request with your changes, or open an Issue to request new features.
This project is licensed under the AGPL 3.0 license. See the LICENSE file for details.