Skip to content

rogeriods/rcleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Cleanup Tool

A fast and simple CLI tool written in Rust to delete files and folders older than a specified age. It recursively scans a directory (default: current folder) and removes items based on their last modified time.

This project I did alongside chatGPT to learn/practice Rust.

Features

  • Delete files and folders older than X days or years
  • Recursive directory traversal
  • Dry-run mode (preview without deleting)
  • Log file with deleted items and errors
  • Skip specific directories (e.g. .git, node_modules)
  • Configurable target path

Installation

Make sure you have Rust installed: https://rust-lang.org Clone the repository and build:

cargo build --release

Run:

./target/release/rcleanup

Usage

Delete files older than 30 days

cargo run --days 30

Delete files older than 2 years

cargo run --years 2

Dry run (recommended first)

cargo run --years 3 --dry-run

Skip directories

cargo run --skip .git --skip node_modules

CLI Options

Option Description
--days Age in days
--years Age in years
--path Target directory (default: .)
--dry-run Show what would be deleted
--log Log file path
--skip Directory names to skip

License

MIT License

About

A tool created to clean files recursively on a current folder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages