linux:logrotate
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| linux:logrotate [2020/03/21 18:26] – kbadmin | linux:logrotate [2020/03/21 18:43] (current) – kbadmin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Apa itu Logrotate | + | ====== |
| Logrotate adalah sistem manajemen yang otomatis merotasi dan mengkompressi file log kemudian menyimpan backupnya dengan nama lain. | Logrotate adalah sistem manajemen yang otomatis merotasi dan mengkompressi file log kemudian menyimpan backupnya dengan nama lain. | ||
| Line 9: | Line 9: | ||
| < | < | ||
| logrotate -v | logrotate -v | ||
| + | </ | ||
| + | ===== Default Setting ===== | ||
| + | Adapun nilai default kita bisa melihatnya di **/ | ||
| + | < | ||
| + | cat / | ||
| + | </ | ||
| + | dan keluar | ||
| + | < | ||
| + | # see "man logrotate" | ||
| + | # rotate log files weekly | ||
| + | weekly | ||
| + | |||
| + | # keep 4 weeks worth of backlogs | ||
| + | rotate 4 | ||
| + | |||
| + | # create new (empty) log files after rotating old ones | ||
| + | create | ||
| + | |||
| + | # use date as a suffix of the rotated file | ||
| + | dateext | ||
| + | |||
| + | # uncomment this if you want your log files compressed | ||
| + | #compress | ||
| + | |||
| + | # RPM packages drop log rotation information into this directory | ||
| + | include / | ||
| + | |||
| + | # no packages own wtmp and btmp -- we'll rotate them here | ||
| + | / | ||
| + | monthly | ||
| + | create 0664 root utmp | ||
| + | minsize 1M | ||
| + | rotate 1 | ||
| + | } | ||
| + | |||
| + | / | ||
| + | missingok | ||
| + | monthly | ||
| + | create 0600 root utmp | ||
| + | rotate 1 | ||
| + | } | ||
| </ | </ | ||
| ===== Contoh 1 ===== | ===== Contoh 1 ===== | ||
| + | Kita ambil contoh dari syslog | ||
| + | < | ||
| + | cat / | ||
| + | </ | ||
| + | keluar | ||
| + | < | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | { | ||
| + | sharedscripts | ||
| + | postrotate | ||
| + | /bin/kill -HUP `cat / | ||
| + | endscript | ||
| + | } | ||
| + | </ | ||
| + | syslog akan merotasi file **cron, | ||
| + | ===== Contoh 2 ===== | ||
| < | < | ||
| / | / | ||
| Line 27: | Line 88: | ||
| **notifempty** tidak akan dirotasi jika file log kosong | **notifempty** tidak akan dirotasi jika file log kosong | ||
| - | ===== Contoh | + | ===== Contoh |
| < | < | ||
| / | / | ||
Layanan
Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |linux/logrotate.1584786391.txt.gz · Last modified: by kbadmin
