Link to home
Start Free TrialLog in
Avatar of AXISHK
AXISHK

asked on

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
}
Avatar of Alex [***Alex140181***]
Alex [***Alex140181***]
Flag of Germany image

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/
Avatar of AXISHK
AXISHK

ASKER

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
You have to use your conf file (/etc/logrotate.d/xxxx) ;-)
Avatar of AXISHK

ASKER

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

Tks again.
I suggest you add ".conf"
SOLUTION
Avatar of Zephyr ICT
Zephyr ICT
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AXISHK

ASKER

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
Avatar of AXISHK

ASKER

Tks