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

Created page with " ## ротировать все файлы /var/log с именами, заканчивающимися на log /var/log/*log { ## выполнять эти команды..."
(Created page with "Ниже приведена ссылка на форум этой страницы, где вы можете разместить любые связанные с ней от...")
Tags: Mobile web edit Mobile edit
(Created page with " ## ротировать все файлы /var/log с именами, заканчивающимися на log /var/log/*log { ## выполнять эти команды...")
Tags: Mobile web edit Mobile edit
Line 315: Line 315:
=== Во-вторых - Создайте /etc/logrotate.d/rotate.logs, используя следующее ===
=== Во-вторых - Создайте /etc/logrotate.d/rotate.logs, используя следующее ===


## rotate all /var/log files with names ending in log
  ## ротировать все файлы /var/log с именами, заканчивающимися на log
  /var/log/*log {
  /var/log/*log {
  ## cycle through these commands once per day
  ## выполнять эти команды один раз в день
   daily
   daily
  ## keep the results of 7 cycles
  ## сохранять результаты 7 циклов
   rotate 7
   rotate 7
  ## use gzip to compress each rotated (copied) log file
  ## использовать gzip для сжатия каждого ротированного (скопированного) файла журнала
   compress
   compress
  ## compress the file on the next cycle
  ## сжимать файл на следующем цикле
   delaycompress
   delaycompress
  ## copy the contents of the log file to a new file <name>.log.1
  ## скопировать содержимое файла журнала в новый файл <имя>.log.1
  ## & then delete the contents of the original log file
  ## и затем удалить содержимое исходного файла
   copytruncate
   copytruncate
  ## do nothing to empty files
  ## ничего не делать с пустыми файлами
   notifempty
   notifempty
  ## create no errors if a file is missing
  ## не выдавать ошибок если файл отсутствует
   missingok
   missingok
  ## after the files have been rotated run the following command
  ## после того, как файлы будут ротированы, выполнить следующую команду
   }  
   }  


<br clear="all"/>
<br clear="all"/>


=== A Summary of the above example thus far ===
=== Краткое изложение приведенного выше примера на данный момент ===


The First step puts a file into '''/etc/cron.daily''' which is an easy way to add the script to a daily cron job. Which means that script will be run everyday.
The First step puts a file into '''/etc/cron.daily''' which is an easy way to add the script to a daily cron job. Which means that script will be run everyday.
translator
10,713

edits