Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
sample /etc/logrotate.d/rsync file ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1222

PostPosted: Mon Dec 19, 2005 7:54 am    Post subject: sample /etc/logrotate.d/rsync file ? Reply with quote

any tips how it should look like?

:roll:
_________________
gentoo user
Back to top
View user's profile Send private message
cyberjun
Apprentice
Apprentice


Joined: 06 Nov 2005
Posts: 293

PostPosted: Mon Dec 19, 2005 12:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
tnt
Veteran
Veteran


Joined: 27 Feb 2004
Posts: 1222

PostPosted: Mon Dec 19, 2005 4:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
cyberjun
Apprentice
Apprentice


Joined: 06 Nov 2005
Posts: 293

PostPosted: Tue Dec 20, 2005 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message
xmit
Apprentice
Apprentice


Joined: 02 Apr 2003
Posts: 158
Location: Hamburg, Germany

PostPosted: Thu Dec 22, 2005 7:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum