Avatar billede carnudo Nybegynder
08. januar 2002 - 10:56 Der er 6 kommentarer og
1 løsning

Debian Logs,

How can I reset all the logs in Debian, I do not want
to use the logrotate, just want to reset them. And they are many, so it has to be something that goes through all of them. Even those inside directories, like /var/logs/apache 
Avatar billede cybermike Nybegynder
09. januar 2002 - 11:39 #1
rm /var/logs
rm /var/logs/apache

should do it...
Avatar billede carnudo Nybegynder
09. januar 2002 - 12:00 #2
For your information.
rm deletes files
rm -R deletes directories.
**********
**********
I do not want to delete the logs, since I am not sure all of them will be recreated. I was thinking more about reseting them. Thanks anyway. I hope somebody comes with a solution.
Avatar billede cybermike Nybegynder
09. januar 2002 - 12:40 #3
delete all files, and run for a day or to. And check which log files that dosnt get recreated and make at script like this:

rm /var/logs
touch /var/logs/lusy_log_that_dosnt_get_recreated
touch /var/logs/another_lousy_log

and ofcause you backup /var/logs before you start.

and by the way, i am familiare with the rm command, but im sure about one thing.
If you do rm -R /var/log  you wont get anylogs bicause the directories will not be recreate.

btw. why are we talking english?
Avatar billede carnudo Nybegynder
09. januar 2002 - 13:05 #4
Yeah I have thought about that too. the thing is that there are lots of directories inside the log directory. And If I plan to do this several times, it will take me long time. I think a perl script maybe could do the task. I dont know.
Anyways I think you deserve the 60 points even though the answer wont solve my questions. Still I think you tried.
Rgds
nb: Why english?, well because I am norwegian and if I write in norwegian you will think I do not know how to spell, as most of the danes think.
Avatar billede cybermike Nybegynder
09. januar 2002 - 13:14 #5
a perl script could solve it, but i think you could do a unhandy but easy trick:

type \"find /var/log>clog1\"
copy it to clog2 edit clog1 it with youre favorite editor and put rm in front of every line and then edit clog2 and put touch in front of every line.

The finaly put #!/bin/sh in top of every line
and make another script like this:


#!/bin/sh
./clog1
./clog2

call it clearlogs and save them all in a directory where they come handy :o)

  Mike

obs. you will get a error message for every directory in /var/lib because it tries to delete them.
Avatar billede carnudo Nybegynder
09. januar 2002 - 15:15 #6
Thanks
Avatar billede cybermike Nybegynder
09. januar 2002 - 15:42 #7
np
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester