Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Logrotate: escludere file da rotazione? [RISOLTO]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
Scen
Retired Dev
Retired Dev


Joined: 29 Jul 2003
Posts: 2470
Location: Padova, Italy

PostPosted: Wed Jul 16, 2008 10:07 am    Post subject: Logrotate: escludere file da rotazione? [RISOLTO] Reply with quote

Ciao a tutti, mi serve un aiutino.

Ho installato app-admin/logrotate per tenere sotto controllo la dimensione dei file di log. La configurazione predefinita mi va anche bene, però vorrei che /var/log/emerge.log venisse escluso COMPLETAMENTE dalla rotazione.

Ho provato a guardare la pagina man e a fare una ricerchina con Zio Google, ma non riesco a trovare informazioni utili a riguardo.

Qualcuno ha avuto la mia stessa necessità (ovvero escludere uno o più file specifici dalla rotazione) ? Se sì, mi può dare qualche dritta?

Grazie 8)

[EDIT]
Con un "trucchetto" ho risolto parzialmente il problema :P

/etc/logrotate.d/emerge:
Code:

/var/log/emerge.log {
        monthly
        nocompress
        size 1G
}


Code:

# logrotate -d -v /etc/logrotate.d/emerge
reading config file /etc/logrotate.d/emerge
reading config info for /var/log/emerge.log

Handling 1 logs

rotating pattern: /var/log/emerge.log  1073741824 bytes (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/emerge.log
  log does not need rotating

Praticamente logrotate non toccherà tale file fino a che non supererà la dimensione di 1 Gigabyte (e ce ne vorrà... :roll: )

Se qualcuno ha in mente soluzioni più eleganti si faccia avanti :wink:
_________________
I was born in a deep forest/I wish I could live here all my life/I am made from stones and roots/My home, these woods and roads
All my life I loved this sound/Of the woods all around/Eagles flies where the winds blows free
Journey is my destiny


Last edited by Scen on Fri Jul 18, 2008 6:49 am; edited 1 time in total
Back to top
View user's profile Send private message
nikko96
Apprentice
Apprentice


Joined: 22 Jul 2005
Posts: 229
Location: Pulcinella's Country

PostPosted: Thu Jul 17, 2008 7:47 pm    Post subject: Re: Logrotate: escludere file da rotazione? [RISOLTO PARZIAL Reply with quote

Scen wrote:
Ciao a tutti, mi serve un aiutino.

Ho installato app-admin/logrotate per tenere sotto controllo la dimensione dei file di log. La configurazione predefinita mi va anche bene, però vorrei che /var/log/emerge.log venisse escluso COMPLETAMENTE dalla rotazione.

Ho provato a guardare la pagina man e a fare una ricerchina con Zio Google, ma non riesco a trovare informazioni utili a riguardo.

Qualcuno ha avuto la mia stessa necessità (ovvero escludere uno o più file specifici dalla rotazione) ? Se sì, mi può dare qualche dritta?

Grazie 8)

[EDIT]
Con un "trucchetto" ho risolto parzialmente il problema :P

/etc/logrotate.d/emerge:
Code:

/var/log/emerge.log {
        monthly
        nocompress
        size 1G
}


Code:

# logrotate -d -v /etc/logrotate.d/emerge
reading config file /etc/logrotate.d/emerge
reading config info for /var/log/emerge.log

Handling 1 logs

rotating pattern: /var/log/emerge.log  1073741824 bytes (no old logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/emerge.log
  log does not need rotating

Praticamente logrotate non toccherà tale file fino a che non supererà la dimensione di 1 Gigabyte (e ce ne vorrà... :roll: )

Se qualcuno ha in mente soluzioni più eleganti si faccia avanti :wink:


Un'altra soluzione,ancora più drastica :P è quella di togliere il file emerge o commentare tutte le sue righe.

ciao
_________________
My system: cpu Intel core 2 duo e6750,mb asus p5n-e sli,scheda grafica nvidia GeForce 9600 GT,kernel 2.6.31-gentoo-r6
Back to top
View user's profile Send private message
Scen
Retired Dev
Retired Dev


Joined: 29 Jul 2003
Posts: 2470
Location: Padova, Italy

PostPosted: Fri Jul 18, 2008 6:49 am    Post subject: Reply with quote

Ecco svelata tutta la mia ignoranza in materia :D

Io pensavo che ci fosse tipo una regola "generale" che mi prendeva in considerazione TUTTI i log contenuti in /var/log/, sovrascritta poi dalle regole specifiche.

Bene, ti ringrazio infinitamente, hai chiarito ogni mio dubbio 8)
_________________
I was born in a deep forest/I wish I could live here all my life/I am made from stones and roots/My home, these woods and roads
All my life I loved this sound/Of the woods all around/Eagles flies where the winds blows free
Journey is my destiny
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano 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