Difference between revisions of "Limit the size of .log files & the journal/ru"

Created page with "По сути, он выполняет эту команду:"
(Created page with "=== Краткое изложение приведенного выше примера на данный момент ===")
(Created page with "По сути, он выполняет эту команду:")
Line 341: Line 341:
Первый шаг помещает файл в '''/etc/cron.daily''', что является простым способом добавить скрипт в ежедневное задание cron. Это означает, что скрипт будет выполняться каждый день.
Первый шаг помещает файл в '''/etc/cron.daily''', что является простым способом добавить скрипт в ежедневное задание cron. Это означает, что скрипт будет выполняться каждый день.


It basically runs this command:
По сути, он выполняет эту команду:


  logrotate /etc/logrotate.conf
  logrotate /etc/logrotate.conf


As logrotate.conf goes through its list of commands it calls this one:
Когда logrotate.conf проходит через свой список команд - он вызывает эту команду:


  include /etc/logrotate.d
  include /etc/logrotate.d


Which means that any scripts that are inside of '''/etc/logrotate.d''' are also run.
Это означает что все скрипты, находящиеся внутри '''/etc/logrotate.d''', также будут запущены.


This brings us to the second step (above), where we created '''/etc/logrotate.d/rotate.logs''' . This script will be run everyday. The comments I added to the rotate.logs file above give a general idea of what it does. You can delete, modify & add to that script, but do it carefully.
This brings us to the second step (above), where we created '''/etc/logrotate.d/rotate.logs''' . This script will be run everyday. The comments I added to the rotate.logs file above give a general idea of what it does. You can delete, modify & add to that script, but do it carefully.
translator
10,713

edits