graph LR
subgraph Automation
T[Systemd Timer] --> S[Systemd Service]
end
subgraph Core Engine
S --> O[Orchestrator]
O --> M1[Cache Cleaner]
O --> M2[Custom Modules...]
end
subgraph Reporting
M1 & M2 --> R[Result Parser]
R --> TL[Telegram Bot]
end
Hygiene-Core is a modular, lightweight maintenance engine designed for Arch Linux. It automates manual cleanup tasks, optimizes system storage, and sends aesthetic reports via Telegram.
- Modular Design: Each task is an independent plugin in
modules/. - Telegram Integration: Instant reporting of cleaned space.
- Safety First: Includes
Dry Runmode andlsofchecks to protect active files. - Idle Execution: Runs via Systemd with idle priority to ensure zero UX impact.
By default, Hygiene-Core is shipped with dry_run: true in config.yaml. In this mode, the engine will scan the system, calculate the potential clean up size, and send the Telegram report, but it will not permanently delete any files.
To execute the actual cleanup process, edit the configuration:
# config.yaml
dry_run: falsegit clone [https://github.com/cybalp/Hygiene-Core](https://github.com/cybalp/Hygiene-Core)
cd Hygiene-Core
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env-example .env # Add your Telegram credentialsTo run Hygiene-Core fully automatically on a schedule (e.g., every Monday at 00:00) and grant it the necessary permissions for system-level cleanups:
- Grant passwordless sudo for specific commands:
To allow the script to clean Arch Linux cache via
pacmanandjournalctl, run this in your terminal:
echo "$USER ALL=(root) NOPASSWD: /usr/bin/pacman -Sc --noconfirm, /usr/bin/pacman -Rns --noconfirm *, /usr/bin/journalctl --vacuum-size=*, /usr/bin/journalctl --vacuum-time=*" | sudo tee /etc/sudoers.d/hygiene-core > /dev/null && sudo chmod 0440 /etc/sudoers.d/hygiene-core && sudo visudo -c- Create the Systemd User Service:
Create
~/.config/systemd/user/hygiene.service:
[Unit]
Description=Hygiene-Core Maintenance Task
After=network-online.target
[Service]
Type=oneshot
WorkingDirectory=%h/SCRIPTS/hygiene-core
ExecStart=%h/SCRIPTS/hygiene-core/venv/bin/python %h/SCRIPTS/hygiene-core/hygiene.py- Create the Timer:
Create
~/.config/systemd/user/hygiene.timer:
[Unit]
Description=Run Hygiene-Core Every Monday at 00:00
[Timer]
OnCalendar=Mon *-*-* 00:00:00
Persistent=true
[Install]
WantedBy=timers.target- Enable Everything:
systemctl --user daemon-reload
systemctl --user enable --now hygiene.timerAdd a .py file to modules/. The orchestrator will auto-discover it.
class MyCustomModule:
def __init__(self, config):
self.config = config
def run(self):
return {"module": "Name", "status": "Success", "cleaned_mb": 10.0}Hygiene-Core, Arch Linux sistemleri için tasarlanmış, modüler ve hafif bir bakım motorudur. Manuel temizlik işlerini otomatize eder, depolamayı optimize eder ve sonuçları Telegram üzerinden raporlar.
- Modüler Tasarım: Her temizlik görevi
modules/altında bağımsız bir eklentidir. - Telegram Entegrasyonu: Temizlenen alan miktarını anında raporlar.
- Güvenlik:
Dry Runmodu velsofkontrolü ile aktif dosyaları korur. - Düşük Öncelikli Çalışma: Systemd üzerinden
idlemodunda çalışarak sistem performansını etkilemez.
Varsayılan olarak Hygiene-Core, config.yaml dosyasında dry_run: true korumasıyla gelir. Bu modda sistem taranır, potansiyel olarak silinebilecek dosya boyutu hesaplanır ve Telegram'a rapor gönderilir, ancak hiçbir dosya fiziksel olarak silinmez.
Sistemi gerçekten temizlemek (silme işlemlerini onaylamak) için yapılandırmayı değiştirin:
# config.yaml
dry_run: falsegit clone [https://github.com/cybalp/Hygiene-Core](https://github.com/cybalp/Hygiene-Core)
cd Hygiene-Core
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env-example .env # Telegram bilgilerini girinHygiene-Core'un arka planda periyodik olarak (örneğin her Pazartesi 00:00'da) çalışması ve sistem seviyesindeki çöpleri temizlemeye yetkisi olması için:
- Gerekli özel root (sudo) izinlerini verin:
Scriptin
pacmanvejournalctliçin pürüzsüz çalışması adına aşağıdaki komutu terminalinize yapıştırın:
echo "$USER ALL=(root) NOPASSWD: /usr/bin/pacman -Sc --noconfirm, /usr/bin/pacman -Rns --noconfirm *, /usr/bin/journalctl --vacuum-size=*, /usr/bin/journalctl --vacuum-time=*" | sudo tee /etc/sudoers.d/hygiene-core > /dev/null && sudo chmod 0440 /etc/sudoers.d/hygiene-core && sudo visudo -c- Systemd Servisini Oluşturun:
~/.config/systemd/user/hygiene.servicedosyasını oluşturun:
[Unit]
Description=Hygiene-Core Maintenance Task
After=network-online.target
[Service]
Type=oneshot
WorkingDirectory=%h/SCRIPTS/hygiene-core
ExecStart=%h/SCRIPTS/hygiene-core/venv/bin/python %h/SCRIPTS/hygiene-core/hygiene.py- Timer (Zamanlayıcı) Dosyasını Oluşturun:
~/.config/systemd/user/hygiene.timerdosyasını oluşturun:
[Unit]
Description=Run Hygiene-Core Every Monday at 00:00
[Timer]
OnCalendar=Mon *-*-* 00:00:00
Persistent=true
[Install]
WantedBy=timers.target- Sistemi Başlatın ve Aktifleştirin:
systemctl --user daemon-reload
systemctl --user enable --now hygiene.timermodules/ dizinine bir .py dosyası ekleyin. Orchestrator onu otomatik olarak keşfedecektir.
class MyCustomModule:
def __init__(self, config):
self.config = config
def run(self):
return {"module": "Name", "status": "Success", "cleaned_mb": 10.0}

TKPTZj988cNC8vPwcexPz8mfrCzYtT7Gkq
USDT (TRC20)


