Logrotate und Dateien Verschieben

FreeBSD, Gentoo, openSUSE, CentOS, Ubuntu, Debian
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Logrotate und Dateien Verschieben

Post by r00ty »

Hallo,
ich habe hier ein Debian Etch Fileserver aufgesetzt und habe das Logverzeichnis auf ein tmpfs gelegt, da ich so vermeide dass die Festplatte andauernd Zugriffe macht.
Jetzt würde ich trotzdem gerne, falls der logrotate Deamon aktiv wird, die Daten auf ein physikalisch existierendes Verzeichnis speichern.
Gibs da ne Idee? Der olddir Parameter funktioniert ja leider nicht da es nicht dasselbe Laufwerk ist...
Vielen Dank schonmal
User avatar
Joe User
Project Manager
Project Manager
Posts: 11190
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Logrotate und Dateien Verschieben

Post by Joe User »

olddir plus mount --bind sollte funktionieren.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: Logrotate und Dateien Verschieben

Post by r00ty »

hmm, wenn ich ehrlich bin kapier ich nicht wie es den Unterschied machen soll...
folgendes hab ich probiert:

/var/logrotate (auf sda1)
/var/log (tmpfs)

Code: Select all

mount -o bind /var/logrotate /var/log/logrotate
In der Logrotate-Config:

Code: Select all

olddir /var/log/logrotate
und es kommt

Code: Select all

reading config info for /var/log/apache2/*.log
olddir is now /var/log/logrotate/apache2
error: apache2:16 olddir /var/log/logrotate/apache2 and log file /var/log/apache2/error.log are on different devices
User avatar
Joe User
Project Manager
Project Manager
Posts: 11190
Joined: 2003-02-27 01:00
Location: Hamburg
 

Re: Logrotate und Dateien Verschieben

Post by Joe User »

OK, hätte ja klappen können :(
Wozu benötigst Du eigentlich (unvollständige) Backups von flüchtigen Daten? Wichtige nicht-statische Daten gehören nicht auf tmpfs oder Ramdisks...
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
r00ty
Posts: 747
Joined: 2003-03-17 15:32
 

Re: Logrotate und Dateien Verschieben

Post by r00ty »

ja, das stimmt schon - aber es ist die einzige Möglichkeit dass ich nicht ständig Festplattenzugriffe habe....
ich werd dann einfach die rotierten Files wegkopieren....