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 {
    missingok
    notifempty
    size 1M
    daily
    compress
    create 0600 root root
}
AXISHKAsked:
Who is Participating?
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.

Alexander Eßer [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


http://www.thecave.info/execute-logrotate-command-manually/
0
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.

Tks
0
Alexander Eßer [Alex140181]Software DeveloperCommented:
You have to use your conf file (/etc/logrotate.d/xxxx) ;-)
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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

Tks again.
0
Alexander Eßer [Alex140181]Software DeveloperCommented:
I suggest you add ".conf"
0
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 ...
0
Alexander Eßer [Alex140181]Software DeveloperCommented:
I don't think the .conf is necessary ...
me neither, but I think it's more "readable" that way ;-)
0

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
0
AXISHKAuthor Commented:
Tks
0
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
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.