Community discussions

MikroTik App
 
andreyy
just joined
Topic Author
Posts: 2
Joined: Wed Feb 01, 2023 9:56 am

Error executing Script RouterOS 7.5

Wed Feb 01, 2023 10:20 am

Hi Community,
We have a problem executing backup script, on an CCR1016. Here is the code (backups device configuration to FTP server):
#### Configuracion del Servidor FTP
:local server "10.1.1.99";
:local port 21;
:local user "xxxxxxx";
:local password "yyyyyyyyyy";

#### Si activamos el historico sube los ficheros con la fecha del dia que se genero
:local historico 1;

:local nombrefichero;
:local systemid;

#### Se toma el nombre del Router y se agrega FTP
:set systemid ("FTP - " .[/system identity get name]);

/system backup save name=$systemid
/export file=$systemid

:if ($historico = "1") do={
:set nombrefichero ("FTP - " .[/system identity get name]."_".[:pick [/system clock get date] 4 6].[:pick [/system clock get date] 0 3].[:pick [/system clock get date] 7 11])

/tool fetch mode=ftp address=$server src-path=($systemid.".rsc") dst-path=($nombrefichero.".rsc") user=$user port=$port password=$password upload=yes keep-result=no
/tool fetch mode=ftp address=$server src-path=($systemid.".backup") dst-path=($nombrefichero.".backup") user=$user port=$port password=$password upload=yes keep-result=no

}

:if ($historico = "0") do={
/tool fetch mode=ftp address=$server src-path=($systemid.".rsc") dst-path=($systemid.".rsc") user=$user port=$port password=$password upload=yes keep-result=no
/tool fetch mode=ftp address=$server src-path=($systemid.".backup") dst-path=($systemid.".backup") user=$user port=$port password=$password upload=yes keep-result=no

}
Error obtained is the following:
script error: action failed (6).

We have the same script running on Mikrotik devices (not CCR1016) on the same version (7.5) and it executes correctly. How could be troubleshoot this error?

Thank you in advance

Andrey.

Who is online

Users browsing this forum: No registered users and 28 guests