View previous topic :: View next topic |
Author |
Message |
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Mon Dec 19, 2005 7:54 am Post subject: sample /etc/logrotate.d/rsync file ? |
|
|
any tips how it should look like?
_________________ gentoo user |
|
Back to top |
|
|
cyberjun Apprentice
Joined: 06 Nov 2005 Posts: 293
|
Posted: Mon Dec 19, 2005 12:15 pm Post subject: |
|
|
here is a sample scrollkeeper
Code: |
# Scrollkeeper logrotate snippet for Gentoo Linux
# contributed by Gad Kadosh
#
/var/log/scrollkeeper.log {
rotate 1
size=100k
}
|
I think rsync should also be similar. It depends what you want to do with it. If u keep the above settings (only changing the filename), the log file will keep archive of just 1 week if in your logrotate.conf you have weekly archiving....
Please read the manual as well.
cheers,
--cyberjun |
|
Back to top |
|
|
tnt Veteran
Joined: 27 Feb 2004 Posts: 1222
|
Posted: Mon Dec 19, 2005 4:17 pm Post subject: |
|
|
thank you for your reply.
I have some logrotate files, but most of them have some kind of "reload service after rotating" thing in them, something like:
Code: | /var/log/apache2/*log {
monthly
rotate 4
missingok
notifempty
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null 2>&1 || true
endscript
} | /etc/init.d/apache2 reload > /dev/null 2>&1 || true
or
Code: | /var/log/jabber/*.log {
rotate 4
compress
size=10000k
postrotate
/sbin/killall -HUP jabberd
endscript
} | /sbin/killall -HUP jabberd
so, I wander how to make rsyncd open a new log file after I rotate old one...
there is no "reload" (or similar) section in /etc/init.d/rsyncd script
is the "-HUP"-way the universal choice? _________________ gentoo user |
|
Back to top |
|
|
cyberjun Apprentice
Joined: 06 Nov 2005 Posts: 293
|
Posted: Tue Dec 20, 2005 1:48 am Post subject: |
|
|
Hi,
I believe there is a file /etc/init.d/rsyncd which can be used to restart the rsyncd. I see that there is no reload option in there. But it can always be stopped and then started.
So your entry should look something like
Code: |
/var/log/rsyncd.log {
monthly
rotate 4
missingok
notifempty
sharedscripts
postrotate
/etc/init.d/rsyncd stop > /dev/null 2>&1 || true
/etc/init.d/rsyncd start > /dev/null 2>&1 || true
endscript
}
|
try it and let us know if it works.
cheers,
--cyberjun |
|
Back to top |
|
|
xmit Apprentice
Joined: 02 Apr 2003 Posts: 158 Location: Hamburg, Germany
|
Posted: Thu Dec 22, 2005 7:35 am Post subject: |
|
|
What is the sense of this "reload service after rotating" behavior? Will I lose messages without? Will the service stop working in some conditions without? |
|
Back to top |
|
|
|