/system logging export pre-reboot:
Code: Select all
# nov/03/2019 11:43:17 by RouterOS 6.46beta59
# software id = [redacted]
#
# model = RouterBOARD 3011UiAS
# serial number = [redacted]
/system logging action
set 0 memory-lines=4096
add disk-file-count=4096 disk-file-name=/usb/logs/system/system-log \
disk-lines-per-file=4096 name=logDisk target=disk
add disk-file-count=4096 disk-file-name=/usb/dude/logs/dude-log \
disk-lines-per-file=4096 name=logDude target=disk
add disk-file-count=4096 disk-file-name=/usb/dude/syslog/syslog \
disk-lines-per-file=4096 name=logDudeSyslog target=disk
add disk-file-count=4096 disk-file-name=/usb/logs/fw/fw-log \
disk-lines-per-file=4096 name=logDiskFW target=disk
add disk-file-count=4096 disk-file-name=/usb/logs/dns/dns-log \
disk-lines-per-file=4096 name=logDiskDNS target=disk
add disk-file-count=4096 disk-file-name=/usb/logs/caps/caps-log \
disk-lines-per-file=4096 name=logDiskCAPs target=disk
/system logging
set 0 topics=info,!firewall,!caps
add action=logDiskFW topics=firewall
add action=logDisk topics=error
add action=logDisk topics=info
add action=logDisk topics=warning
add action=logDiskDNS topics=dns,!packet
add action=logDisk topics=critical
add action=logDudeSyslog topics=dude,event
add action=logDude topics=dude,!event
add action=logDiskFW topics=upnp
add action=logDiskCAPs topics=caps
/system logging export post-reboot:
Code: Select all
# [cut]
/system logging action
set 0 memory-lines=4096
/system logging
set 0 topics=info,!firewall,!caps
add topics=firewall
add topics=error
add topics=info
add topics=warning
add topics=dns,!packet
add topics=critical
add topics=dude,event
add topics=dude,!event
add topics=upnp
add topics=caps
Printout shows missing links to now non-existent logging actions:
Code: Select all
/system logging print
Flags: X - disabled, I - invalid, * - default
# TOPICS ACTION PREFIX
0 * info memory
!firewall
!caps
1 * error memory
2 * warning memory
3 * critical echo
4 I firewall *7
5 I error *4
6 I info *4
7 I warning *4
8 I dns *8
!packet
9 I critical *4
10 I dude *6
event
11 I dude *5
!event
12 I upnp *7
13 I caps *9
The disk is an old 180Gb Intel i520 SSD in USB 2.0 enclosure, renamed to "usb" for clarity.
Code: Select all
/disk print
# NAME LABEL TYPE DISK FREE SIZE
0 usb i520-180G ext3 External 166.3GiB 167.7GiB
The Dude has no problem working with its base on the disk.
I haven't experienced such problem with the same configuration several months ago, when I've used a 64Gb USB 3.0 stick for the same purposes, with the latest beta ROS releases at the time.
Since that time the stick has failed, and I've switched to a real drive, ROS was updated to fresh betas several times.
I could restore actions after reboot with a startup schedule as a temporary workaround:
Code: Select all
/system scheduler add name=sched-restore-logging-actions on-event="delay 10; /system script run scr-restore-logging-actions" policy= read,write start-time=startup
The schedule launches this script:
Code: Select all
:if ([/system logging action print count-only where name=logDisk]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/logs/system/system-log disk-lines-per-file=4096 name=logDisk target=disk}
:if ([/system logging action print count-only where name=logDiskFW]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/logs/fw/fw-log disk-lines-per-file=4096 name=logDiskFW target=disk}
:if ([/system logging action print count-only where name=logDiskDNS]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/logs/dns/dns-log disk-lines-per-file=4096 name=logDiskDNS target=disk}
:if ([/system logging action print count-only where name=logDiskCAPs]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/logs/caps/caps-log disk-lines-per-file=4096 name=logDiskCAPs target=disk}
:if ([/system logging action print count-only where name=logDude]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/dude/logs/dude-log disk-lines-per-file=4096 name=logDude target=disk}
:if ([/system logging action print count-only where name=logDudeSyslog]=0) do={/system logging action add disk-file-count=4096 disk-file-name=/usb/dude/syslog/syslog disk-lines-per-file=4096 name=logDudeSyslog target=disk}
/system logging set [find topics="critical" and default=no] action=logDisk
/system logging set [find topics="error" and default=no] action=logDisk
/system logging set [find topics="warning" and default=no] action=logDisk
/system logging set [find topics="info" and default=no] action=logDisk
/system logging set [find topics="caps"] action=logDiskCAPs
/system logging set [find topics="dns;!packet"] action=logDiskDNS
/system logging set [find topics="firewall"] action=logDiskFW
/system logging set [find topics="upnp"] action=logDiskFW
/system logging set [find topics="dude;!event"] action=logDude
/system logging set [find topics="dude;event"] action=logDudeSyslog
Looks like the problem is a delay needed for disk startup - I've noticed that "delay 5" in the schedule is insufficient and results in "script error: failure: bad disk file name".
Note that just importing a file with a bunch of "/system logging action add" in the proper order (as I've first tried as a fast-and-dirty fix) doesn't work - sometimes it's OK, but most times the actions are getting mixed up.
Suggestions are welcome.