{"id":18099398,"url":"https://github.com/elliotsecops/log-cleaner","last_synced_at":"2026-02-13T10:39:34.233Z","repository":{"id":257503659,"uuid":"858470451","full_name":"elliotsecops/Log-Cleaner","owner":"elliotsecops","description":" Script Bash minimalista diseñado para limpiar y comprimir archivos de registro antiguos para liberar espacio en disco. //  minimalistic Bash script designed to clean and compress old log files to free up disk space.","archived":false,"fork":false,"pushed_at":"2024-10-30T23:44:31.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T23:41:39.181Z","etag":null,"topics":["bash","bash-script","bash-scripting","linux-administration","log-analysis","security-analysis","sysadmin","sysadmin-scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elliotsecops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-17T00:28:44.000Z","updated_at":"2024-10-31T22:22:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"c65f52dd-1c46-4c7d-82c8-091933bc6a00","html_url":"https://github.com/elliotsecops/Log-Cleaner","commit_stats":null,"previous_names":["elliotsecops/log-cleaner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elliotsecops/Log-Cleaner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotsecops%2FLog-Cleaner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotsecops%2FLog-Cleaner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotsecops%2FLog-Cleaner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotsecops%2FLog-Cleaner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elliotsecops","download_url":"https://codeload.github.com/elliotsecops/Log-Cleaner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elliotsecops%2FLog-Cleaner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272965354,"owners_count":25023066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","bash-scripting","linux-administration","log-analysis","security-analysis","sysadmin","sysadmin-scripts"],"created_at":"2024-10-31T21:08:31.925Z","updated_at":"2026-02-13T10:39:34.188Z","avatar_url":"https://github.com/elliotsecops.png","language":"Shell","readme":"# Log Cleaner\n\nThis script cleans and compresses old log files to free up disk space. It identifies log files older than a specified number of days, compresses them with `gzip`, moves them to an archive directory, and generates a summary report.\n\n## Features\n\n- **Automated Cleaning:** Automatically identifies and compresses old log files.\n- **Configurable:** Customize log directory, archive directory, and age threshold.\n- **Compression:** Uses `gzip` for efficient disk space savings.\n- **Archiving:** Moves compressed logs to a dedicated archive directory.\n- **Detailed Reporting:** Provides a summary of processed files, sizes, and space saved.\n- **Robust Error Handling:** Extensive error checking and logging for reliability.\n- **Safe File Operations:** Ensures successful compression and move before deleting originals.\n\n## Usage\n\n1. **Clone:**\n   ```bash\n   git clone https://github.com/elliotsecops/Log-Cleaner.git\n   cd Log-Cleaner\n   ```\n\n2. **Make Executable:**\n   ```bash\n   chmod +x log_cleaner.sh\n   ```\n\n3. **Run:**\n   ```bash\n   sudo ./log_cleaner.sh [LOG_DIR] [ARCHIVE_DIR] [DAYS_OLD]\n   ```\n\n   - **`LOG_DIR`**: Directory containing log files (default: `/var/log`).\n   - **`ARCHIVE_DIR`**: Directory to store compressed logs (default: `/var/log/archive`).\n   - **`DAYS_OLD`**: Age threshold for compression (default: 7 days).\n\n   **Example (Custom Configuration):**\n   ```bash\n   sudo ./log_cleaner.sh /var/log/myapp /var/log/myapp/archive 30\n   ```\n\n## Log Files\n\n- **Report:** `/tmp/log_cleaner_report.txt`\n- **Errors:** `/tmp/log_cleaner_errors.txt`\n\n## Dependencies\n\n- `bash`\n- `gzip`\n- `find`\n- `stat`\n- `awk`\n\n## Contributing\n\nContributions are welcome! Open an issue or submit a pull request.\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotsecops%2Flog-cleaner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felliotsecops%2Flog-cleaner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felliotsecops%2Flog-cleaner/lists"}