Problem running script(s)
Posted: Tue Jul 24, 2018 2:25 am
Hello,
I have quite a weird problem with running my scripts.
Problem:
I have a script, that basically runs every day at 3AM and takes a backup from my router.
It works perfectly fine, but after some time (1 day or more) the script stops working. With error message: script error: action failed (6).
I've found a temporary solution for that. If I restart my router, then this script works fine again. But I really don't want to restart my router every day.
Script:
Router information:
Model: 951G-2HnD
Firmware: 6.42.6
RouterOS: 6.42.6
PS: I've only added one script, because other scripts have the same problem.
I have quite a weird problem with running my scripts.
Problem:
I have a script, that basically runs every day at 3AM and takes a backup from my router.
It works perfectly fine, but after some time (1 day or more) the script stops working. With error message: script error: action failed (6).
I've found a temporary solution for that. If I restart my router, then this script works fine again. But I really don't want to restart my router every day.
Script:
Code: Select all
:global getDateTime do={
:local thisdate [/system clock get date];
:local year [:pick $thisdate 7 11];
:local month [:pick $thisdate 0 3];
:if ($month="jan") do={[:set $month "01"]};
:if ($month="feb") do={[:set $month "02"]};
:if ($month="mar") do={[:set $month "03"]};
:if ($month="apr") do={[:set $month "04"]};
:if ($month="may") do={[:set $month "05"]};
:if ($month="jun") do={[:set $month "06"]};
:if ($month="jul") do={[:set $month "07"]};
:if ($month="aug") do={[:set $month "08"]};
:if ($month="sep") do={[:set $month "09"]};
:if ($month="oct") do={[:set $month "10"]};
:if ($month="nov") do={[:set $month "11"]};
:if ($month="dec") do={[:set $month "12"]};
:local day [:pick $thisdate 4 6];
:local datetimestring ([$day] . "." . [$month] . "." . [$year]);
:return ($datetimestring)
}
/system backup save name=("disk1/backups/" . [$getDateTime] . ".backup")
/export file=("disk1/backups/" . [$getDateTime] . ".rsc")
Router information:
Model: 951G-2HnD
Firmware: 6.42.6
RouterOS: 6.42.6
PS: I've only added one script, because other scripts have the same problem.