📘 Este repositorio está disponible en español e inglés.
📗 This repository is available in Spanish and English.🧾 Ver versión en español más abajo.
🧾 Scroll down for the English version.
Este repositorio contiene una plantilla de script PowerShell para automatizar la eliminación de archivos antiguos en servidores Windows.
This repository contains a PowerShell script template to automate old file cleanup on Windows servers.
- 🕐 Elimina archivos según la antigüedad configurada / Deletes files based on configurable retention days
- 📂 Permite excluir carpetas / Allows excluding specific folders
- 🧪 Modo simulación disponible / Simulation mode available
- 📜 Crea logs de la limpieza / Generates daily cleanup logs
- 🔁 Elimina también logs antiguos (más de 1 año) / Also deletes logs older than 1 year
- 🌐 Disponible en español e inglés / Available in Spanish and English
📁 /Scripts/
│ ├── LimpiarFicheros.ps1 ← Español / Spanish
│ ├── CleanupFiles.ps1 ← Inglés / English
│ └── config.json ← Archivo de configuración / Configuration file
{
"Jobs": [
{
"Path": "C:\Ruta\AEvaluar",
"KeepDays": 30,
"ExcludeFolders": ["Importante"]
}
],
"DryRun": true,
"LogDirectory": "C:\LogsLimpieza"
}
"DryRun": true
= solo simula, no borra"DryRun": false
= realiza el borrado real
powershell.exe -ExecutionPolicy Bypass -File "C:\Scripts\LimpiarFicheros.ps1"
Español (ES) | Inglés (EN) |
---|---|
LimpiarFicheros.ps1 |
CleanupFiles.ps1 |
config.json |
config.json |
README.md |
README_EN.md |
LICENSE |
LICENSE |
2025-04-02 08:29:32 - ===== INICIO DE LIMPIEZA =====
2025-04-02 08:29:32 - Ruta: C:\Users\...\Prueba
2025-04-02 08:29:32 - [SIMULACIÓN] Eliminaría: ...\archivo.log
...
2025-04-02 08:29:32 - ===== FIN DE LIMPIEZA =====
2025-04-02 08:29:32 - ===== CLEANUP STARTED =====
2025-04-02 08:29:32 - Path: C:\Users\...\Test
2025-04-02 08:29:32 - [SIMULATION] Would delete: ...\file.log
...
2025-04-02 08:29:32 - ===== CLEANUP COMPLETED =====
Este proyecto se publica bajo licencia MIT.
This project is released under the MIT License.
Pull requests bienvenidos. Traducciones o mejoras también.
Pull requests welcome. Translations or improvements appreciated.