Hi all,
i m looking for a script to save the logs 1 time per day (to my cf card) and then send it to my email.
Can anybody help me ?
/system script add name="LogDump" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source="
:local body
:foreach int in=[/log find ] do={
:set body ("$body\r\n" . [/log get $int])
}
/tool e-mail send to="YOU@DOMAIN.COM" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$body
/system logging action set memory memory-lines=1
/system logging action set memory memory-lines=100"
/system script add disabled=no interval=1d name="Run Log Dump" on-event=LogDump start-date=jan/01/1970 start-time=00:00:00
thank you for you reply....Code: Select all/system script add name="LogDump" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source=" :local body :foreach int in=[/log find ] do={ :set body ("$body\r\n" . [/log get $int]) } /tool e-mail send to="YOU@DOMAIN.COM" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$body /system logging action set memory memory-lines=1 /system logging action set memory memory-lines=100"
-LouisCode: Select all/system script add disabled=no interval=1d name="Run Log Dump" on-event=LogDump start-date=jan/01/1970 start-time=00:00:00
wordpadthank you for you reply....Code: Select all/system script add name="LogDump" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff source=" :local body :foreach int in=[/log find ] do={ :set body ("$body\r\n" . [/log get $int]) } /tool e-mail send to="YOU@DOMAIN.COM" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$body /system logging action set memory memory-lines=1 /system logging action set memory memory-lines=100"
-LouisCode: Select all/system script add disabled=no interval=1d name="Run Log Dump" on-event=LogDump start-date=jan/01/1970 start-time=00:00:00
I found at the forum, but again thank you very much!!!!
Btw, do u suggest any program to analysing this log files ?
source="
:local body
:foreach int in=[/log find ] do={
:set body ("$body\r\n" . [/log get $int])
}
/tool e-mail send to="YOU@DOMAIN.COM" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$body
/system logging action set memory memory-lines=1
/system logging action set memory memory-lines=100"
:set body ("$body\r\n" . [/log get $int])
:set body ("$body\r\n" . [/log get $int message])
#read log
:local logcontent
:foreach int in=[/log find ] do={
:set logcontent ("$logcontent\r\n" .[/log get $int time]. " - " .[/log get $int message])
}
#send email
/tool e-mail send to="log@xxxx.xxx" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$logcontent
#delete old log
/system logging action set memory memory-lines=1
/system logging action set memory memory-lines=65000
[erik@Trekanten] > #read log
[erik@Trekanten] > :local logcontent
[erik@Trekanten] > :foreach int in=[/log find ] do={
{... :set logcontent ("$logcontent\r\n" .[/log get $int time]. " - " .[/log get $int message])
{... }
no such command or directory (find)
invalid expression
/system script add name="LogDump" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff
#read log
:local logcontent
:foreach int in=[/log find ] do={
:set logcontent ("$logcontent\r\n" .[/log get $int time]. " - " .[/log get $int message])
}
#send email
/tool e-mail send to="log@xxxx.xxx" subject=([/system identity get name] . " Log " . [/system clock get date]) body=$logcontent
#delete old log
/system logging action set memory memory-lines=1
/system logging action set memory memory-lines=65000
So known "non working" is better than "unknown"?I don't trust the new versions of ros [past experience] ...always tends to be full of bugs
I think the logic goes more like "known to be little broken" is better than "maybe more broken".So known "non working" is better than "unknown"?
/system logging action set 1 disk-file-count=20 disk-file-name=/usb1/log disk-lines-per-file=2000regular script for sending:
/tool e-mail send to="my.email" subject=([/system identity get name] . \ " SystemLog") from=my.device.email file=usb1/log.0.txtHave you read your error message posted here?? it says that script with such name already exists...
I've just found this post, seems nice, but how do you do deal with duplicate or missing stuff?ros code
/system logging action set 1 disk-file-count=20 disk-file-name=/usb1/log disk-lines-per-file=2000regular script for sending:ros code
/tool e-mail send to="my.email" subject=([/system identity get name] . \ " SystemLog") from=my.device.email file=usb1/log.0.txt