Community discussions

MikroTik App
 
User avatar
gustkiller
Member
Member
Topic Author
Posts: 419
Joined: Sat Jan 07, 2006 5:15 am
Location: Brazil
Contact:

How to reset the log file and then backup it?

Wed Mar 08, 2006 3:33 am

Hi ppl

i was wondering how to reset the system Log once a month and before reset it save it to disk.

i already know how to save the current log file to disk and script it but i dont know how to clear the log file.. n1 can helpme?

thanks

Gustavo Santos
NetStream
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Wed Mar 08, 2006 2:01 pm

You cannot clear the log. Have your MikroTik log to a remote syslog server and doing you log management/archiving there would be the solution...

Best regards,
Christian Meis
 
User avatar
gustkiller
Member
Member
Topic Author
Posts: 419
Joined: Sat Jan 07, 2006 5:15 am
Location: Brazil
Contact:

Thu Mar 09, 2006 3:19 am

thanks Cmit do u know some free syslog server for windows 2003?
 
changeip
Forum Guru
Forum Guru
Posts: 3830
Joined: Fri May 28, 2004 5:22 pm

Thu Mar 09, 2006 5:55 am

Mikrotik has one on their download page that works pretty decent.

Sam
 
odie
Member Candidate
Member Candidate
Posts: 216
Joined: Wed Mar 23, 2005 8:31 am
Location: Austria
Contact:

Thu Mar 09, 2006 8:56 am

http://www.kiwisyslog.com/
there is also a freeware version ....
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Thu Mar 09, 2006 10:41 am

I would also heavily recommend Kiwi products - they are really good quality...

Best regards,
Christian Meis
 
User avatar
gustkiller
Member
Member
Topic Author
Posts: 419
Joined: Sat Jan 07, 2006 5:15 am
Location: Brazil
Contact:

Fri Mar 10, 2006 2:15 am

thanks ppl for the help! everything running fine now !
 
User avatar
Nexon
newbie
Posts: 27
Joined: Tue Jan 31, 2006 9:38 am
Location: Serbia
Contact:

Log to e-mail

Fri Apr 07, 2006 12:07 pm

I have two scripts one to make log file every day and second to e-mail to me . That is another way to solve the problem...
 
minist@r
just joined
Posts: 9
Joined: Thu Aug 25, 2005 10:08 am
Location: Serbia

Re: Log to e-mail

Thu Apr 27, 2006 3:24 am

I have two scripts one to make log file every day and second to e-mail to me . That is another way to solve the problem...
Can you post your scripts here?
 
User avatar
Nexon
newbie
Posts: 27
Joined: Tue Jan 31, 2006 9:38 am
Location: Serbia
Contact:

The scripts

Wed Oct 25, 2006 5:09 pm

Make log file: /log print file=log

Send it to mail: /tool e-mail send file=log.txt to=xxx@xxx.xx body=logfile subject=mikrotiklog

Than reboot: /system reboot

You must set up the system scheduler to activate these scripts at a regular time.
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Wed Oct 25, 2006 10:12 pm

I have to take back my statement from above - I just stumbled upon a way to indeed clear the log!
You can set the memory-lines (or disk-lines) parameter to "1" (0 isn't valid) and then back to the value you want to have (like the default "100") - this will clear the log just leaving the first line - which will then always read "log action changed by admin"...

So:
/system logging action set [/system logging action find name="memory"] memory-lines=1
/system logging action set [/system logging action find name="memory"] memory-lines=100
to clear the memory syslog content.

You could combine this with the e-mail script Nexon posted. But no more need to reboot the machine to get rid of the memory log file... :D

Best regards,
Christian Meis

Who is online

Users browsing this forum: GoogleOther [Bot] and 91 guests