Setup logrotate on Linux

I have setup a logrotate for a linux daemon, under /etc/logrotate.d/xxxx. Is that all for setting up a logrotate ? How can I click out a logrotate to test the logrotate at once ? Tks

/var/log/xxxx.log  /var/log/yyyy.log {
    size 1M
    create 0600 root root
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alex [***Alex140181***]Software DeveloperCommented:
How can I click out a logrotate to test the logrotate at once ?
Could you please explain?! Do you mean "force a log rotation"?!

logrotate -vf /etc/logrotate.d/your_logrotate.conf

Open in new window
AXISHKAuthor Commented:
Yes, I want to verify whether my new created logrotate works or not.

Under /etc/logrotate.d/, do I need to add your_logrotate.conf or just your_logrotate (without .conf) ?

Currently, I'm using the latter one.

Alex [***Alex140181***]Software DeveloperCommented:
You have to use your conf file (/etc/logrotate.d/xxxx) ;-)
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

AXISHKAuthor Commented:
Do I need to add extension to the file , ie should the file be rsyncd or rsyncd.conf ?  

Tks again.
Alex [***Alex140181***]Software DeveloperCommented:
I suggest you add ".conf"
Zephyr ICTCloud ArchitectCommented:
I don't think the .conf is necessary ...

That being said, you can check if your logs are being rotated by doing:

cat /var/lib/logrotate.status

Open in new window

Forgot to add ... If you change the date of the logs in this file logrotate should start rotating the logs immediately ...
Alex [***Alex140181***]Software DeveloperCommented:
I don't think the .conf is necessary ...
me neither, but I think it's more "readable" that way ;-)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AXISHKAuthor Commented:
Try :

logrotate /etc/logrotate.d/lsyncd
cat /var/lib/logrotate.status. The status show two lines below. However, the file doesn't rotate as expected. THe script was attached above. Any idea ?  Tks

"/var/log/lsyncd/lsyncd.log" 2015-7-22
"/var/log/lsyncd/lsyncd-status.log" 2015-7-22
AXISHKAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.