How to reset the log file and then backup it?

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

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

thanks Cmit do u know some free syslog server for windows 2003?

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

Sam

http://www.kiwisyslog.com/
there is also a freeware version …

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

Best regards,
Christian Meis

thanks ppl for the help! everything running fine now !

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?

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.

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… :smiley:

Best regards,
Christian Meis