Alibaba OSS Bucket Cleaner

Automated tool to efficiently clean up and manage Alibaba Cloud Object Storage Service buckets worldwide

Key Features

Powerful features to help you manage your Alibaba Cloud OSS buckets efficiently

🗑️

Bulk Object Deletion

Delete thousands of objects from your OSS buckets with a single command. Perfect for cleaning up old backups and temporary files.

🔍

Smart Filtering

Filter objects by date range, file size, file type, and naming patterns. Only delete what you actually want to remove.

🛡️

Safe Operations

Built-in safety checks and confirmation prompts prevent accidental deletions. Dry-run mode lets you preview changes first.

📊

Detailed Reporting

Comprehensive logs and reports show exactly what was deleted, when, and how much storage space was freed up.

💰

Cost Optimization

Reduce your Alibaba Cloud storage costs by removing unnecessary files and optimizing your bucket usage patterns.

High Performance

Optimized for speed with concurrent operations and efficient API usage to handle large-scale cleanup operations.

Quick Start

Get started with the Alibaba OSS Bucket Cleaner in minutes

Installation

# Clone the repository
git clone https://github.com/CODEWAVE-TECHNOLOGIES-SDN-BHD/alibaba-oss-bucket-cleaner.git

# Navigate to the project directory
cd alibaba-oss-bucket-cleaner

# Install dependencies
pip install -r requirements.txt

Configuration

# Set your Alibaba Cloud credentials
export ALIBABA_CLOUD_ACCESS_KEY_ID="your-access-key"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your-secret-key"
export ALIBABA_CLOUD_REGION="your-region"

Usage Examples

List all objects in a bucket

python oss_cleaner.py --bucket my-bucket --list

Delete objects older than 30 days (dry run)

python oss_cleaner.py --bucket my-bucket --older-than 30 --dry-run

Delete objects with specific prefix

python oss_cleaner.py --bucket my-bucket --prefix "temp/" --confirm

Delete objects larger than 100MB

python oss_cleaner.py --bucket my-bucket --min-size 100MB --confirm