# Searchable Keywords: log rotate Open source log rotating utillity Available on linux abd other fine unices NAME logrotate - rotates, compresses, and mails system logs SYNOPSIS logrotate [-dv] [-f|--force] [-s|--state file] con­ fig_file+ DESCRIPTION logrotate is designed to ease administration of systems that generate large numbers of log files. It allows auto­ matic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large. Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the cri­ terium for that log is based on the log's size and logro­ tate is being run multiple times each day, or unless the -f or -force option is used. Any number of config files may be given on the command line. Later config files may override the options given in earlier files, so the order in which the logrotate config files are listed in is important. Normally, a single con­ fig file which includes any other config files which are needed should be used. See below for more information on how to use the include directive to accomplish this. If a directory is given on the command line, every file in that directory is used as a config file. OPTIONS -d Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file. -f, --force Tells logrotate to force the rotation, even if it doesn't think this is necessary. Sometimes this is useful after adding new entries to logrotate, or if old log files have been removed by hand, as the new files will be created, and logging will continue correctly. -s, --state Tells logrotate to use an alternate state file. This is useful if logrotate is being run as a dif­ ferent user for various sets of log files. The default state file is /var/lib/logrotate.status. --usage Prints a short usage message. ------- An example of a live lograte file on pingy ---------------- # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # send errors to root errors root # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own lastlog or wtmp -- we'll rotate them here /var/log/wtmp { monthly create 0664 root utmp rotate 1 } # system-specific logs may be configured here