Cov txheej txheem:

Logrotate yog dab tsi?
Logrotate yog dab tsi?

Video: Logrotate yog dab tsi?

Video: Logrotate yog dab tsi?
Video: Perl driven Apliance 2024, Kaum ib hlis
Anonim

logrotate yog tsim los kom yooj yim rau kev tswj hwm cov tshuab uas tsim kom muaj cov ntaub ntawv teev tseg ntau. Nws tso cai rau kev sib hloov tsis siv neeg, compression, tshem tawm, thiab xa cov ntaub ntawv log. Txhua cov ntaub ntawv teev cia yuav raug ua txhua hnub, txhua lub limtiam, txhua hli, lossis thaum nws loj dhau. Nquag, logrotate yog khiav raws li txoj haujlwm cron txhua hnub.

Yog li ntawd, Logrotate txhais li cas?

Kev piav qhia. logrotate yog tsim los kom yooj yim rau kev tswj hwm cov tshuab uas tsim kom muaj cov ntaub ntawv teev tseg ntau. Nws tso cai rau kev sib hloov tsis siv neeg, compression, tshem tawm, thiab xa cov ntaub ntawv log. Txhua cov ntaub ntawv teev cia yuav raug ua txhua hnub, txhua lub limtiam, txhua hli, lossis thaum nws loj dhau. Nquag, logrotate yog khiav raws li txoj haujlwm cron txhua hnub.

Tsis tas li ntawd, Logrotate Copytruncate ua haujlwm li cas? copytruncate : Tshem tawm cov ntaub ntawv keeb kwm yav dhau los hauv qhov chaw tom qab tsim ib daim ntawv theej, es tsis txhob txav cov ntaub ntawv log qub thiab xaiv tsim ib qho tshiab. Nws ua tau siv tau thaum qee qhov kev pab cuam tsis tuaj yeem hais kom kaw nws cov logfile thiab yog li yuav txuas ntxiv sau ntawv (appending) rau cov ntaub ntawv teev tseg dhau los mus ib txhis.

Tsis tas li ntawd, koj siv Logrotate li cas?

HowTo: Qhov kawg Logrotate Command Tutorial nrog 10 Piv txwv

  1. Tig lub log ntaub ntawv thaum cov ntaub ntawv loj mus txog qhov loj me.
  2. Txuas ntxiv sau cov ntaub ntawv teev cia rau cov ntaub ntawv tsim tshiab tom qab tig cov ntaub ntawv log qub.
  3. Compress cov ntaub ntawv rotated.
  4. Qhia meej qhov kev xaiv compression rau cov ntaub ntawv hloov pauv.
  5. Tig cov ntaub ntawv log qub nrog hnub tim hauv lub npe file.

Kuv yuav paub li cas yog tias Logrotate ua haujlwm?

5 Teb. Rau txheeb xyuas yog tias ib lub cav yog qhov tseeb tig los yog tsis thiab rau kuaj hnub kawg thiab lub sijhawm ntawm nws txoj kev sib hloov, kuaj the /var/lib/ logrotate /status file. Qhov no yog cov ntaub ntawv zoo nkauj uas muaj cov ntaub ntawv teev npe thiab hnub uas nws tau tig kawg.

Pom zoo: