xcleanup is a scheduled CLI tool that cleans files and directories on servers using safe configuration rules. It supports confirmation mode, dry-run, logging, and notifications after completion.
- Scan by allowed and excluded paths.
- Filter by file age and deletion limits.
- Emergency mode when disk space is low.
- Dry-run to preview the cleanup plan.
- JSON or text logging.
- Email/Slack/Discord/Telegram notifications.
- Install PHP 8.2+ and Composer.
- Install dependencies:
composer install
- Copy configuration:
cp config/config.php.example config/config.php
- (Optional) Set environment variables in
.env.
- Run with defaults:
php bin/cleanup
- Run with a custom config:
php bin/cleanup --config=/etc/xcleanup/config.php
- Dry-run:
php bin/cleanup --dry-run
- Skip confirmation:
php bin/cleanup --quiet
- Edit
config/config.phpfor allowed/excluded paths and retention rules. - Use
.envfor notifier credentials.
composer testcomposer stancomposer lint
See CONTRIBUTING.md.
Apache License 2.0. See LICENSE.