Hallo liebes rootforum;
ich habe mal eine Frage, besteht die Möglichkeit die Logfiles wenn der Wunsch besteht Sie zu bereinigen, dieses auch schnell zu erledigen; bisher kenne ich nur die Möglichkeit über Putty z.B.:
>access.log einzugeben und dann wird diese Datei geleert / nicht gelöscht...
Wie könnte ich nun, dass für alle Dateien erledigen??? Danke für Eure Hilfe...
Logfiles /var/log/* bereinigen (Script?)
Re: Logfiles /var/log/* bereinigen (Script?)
Die Frage nach dem Sinn und den Hinweis auf logrotate erspare ich mir einfach mal:
Code: Select all
for file in `find /var/log -type f`
do
>${file}
done
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings 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.
Wings for Life ● Wings 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.
-
orinocodelta
- Posts: 10
- Joined: 2008-01-30 05:32
Re: Logfiles /var/log/* bereinigen (Script?)
OK das geht, allerdings kannst Du mich auch kurz aufklären über logrotate, denke das ich nicht die feine englische Art gewählt habe....Joe User wrote:Die Frage nach dem Sinn und den Hinweis auf logrotate erspare ich mir einfach mal:Code: Select all
for file in `find /var/log -type f` do >${file} done
Re: Logfiles /var/log/* bereinigen (Script?)
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings 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.
Wings for Life ● Wings 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.
