devops101 › Cheat sheet'ler › ⚙️ systemd & journalctl cheat sheet

⚙️ systemd & journalctl cheat sheet

Servis yönetimi

systemctl status nginxDurum
systemctl start|stop|restart nginxBaşlat/durdur/yeniden başlat
systemctl reload nginxYapılandırmayı yeniden yükle
systemctl enable --now nginxAçılışta ve şimdi başlat
systemctl disable nginxAçılıştan kaldır
systemctl daemon-reloadUnit dosyası değişince
systemctl list-units --failedBaşarısız servisler
systemctl cat nginxUnit dosyasını göster
systemctl edit nginxOverride oluştur

Loglar (journalctl)

journalctl -u nginx -fServis logu canlı
journalctl -u nginx --since "1 hour ago"Son 1 saat
journalctl -p err -bBu açılıştan hatalar
journalctl -kÇekirdek logları
journalctl --disk-usageLog boyutu
journalctl --vacuum-time=7d7 günden eskiyi sil

Zamanlayıcı ve cron

systemctl list-timersZamanlayıcılar
crontab -eCron düzenle
crontab -lCron listele
*/5 * * * *Her 5 dakika
0 3 * * *Her gece 03:00
0 9 * * 1Pazartesi 09:00
@rebootAçılışta

Uygulamada aç ve alıştırmaları çöz →