Logrotate: lines must begin with a keyword or a filename

How to fix lines must begin with a keyword or a filename error from Logrotate.

Generally, this error appears when the Logrotate configuration is edited with a bad format (you must save the configuration file with a Unix format).

Convert the Logrotate configuration file to use Unix format:

$ dos2unix -b /etc/logrotate.d/my_file