Forrest logo
back to the logrotate tool

logrotate:tldr:f2727

logrotate: Trigger a run manually.
$ logrotate ${path-to-logrotate-conf} --force
try on your machine

The command logrotate is used to manage and rotate log files in a Linux system. It compresses and archives old log files, removing them after a certain threshold.

The command you provided, logrotate ${path-to-logrotate-conf} --force, is calling the logrotate program and passing two arguments: ${path-to-logrotate-conf} and --force.

${path-to-logrotate-conf} is a placeholder indicating that you need to replace it with the actual path to the logrotate configuration file you want to use. This configuration file defines the log files to be rotated, compression options, rotation intervals, and other settings.

The --force flag is used to forcefully rotate the log files even if they are not due for rotation based on the configuration settings. This flag is helpful if you want to manually trigger a log rotation, regardless of the time or size thresholds defined in the configuration file.

When you run this command, logrotate will execute the log rotation based on the specified configuration file and force the rotation to occur, regardless of the predefined rotation schedule.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the logrotate tool