run specific logrotate 1

run specific logrotate

logrotate --force $CONFIG_FILE
--force will force rotation even if files do not meet criteria (age, size, etc), but please consider that this is the only way to spot real problems that with logrotate -d would not emerge
logrotate -d [your_config_file] invokes debug mode, giving you a verbose description of what would happen, but leaving the log files untouched.

Here is what the above code is Doing:
1. The first line is the shebang line. It tells the shell what program to use to run the script.
2. The second line is a comment. It’s ignored by the shell.
3. The third line is a command. It tells the shell to run the logrotate program with the –force option and the name of the configuration file.
4. The fourth line is another comment.
5. The fifth line is another command. It tells the shell to run the logrotate program with the -d option and the name of the configuration file.

Similar Posts