I have uplaod it using FTP
Very good. User should have all permision, like Full group. You can next experiment and create own group without necessery permition but remember after some upgrade RouterOS some rights can be change.
.
.
and when the script is working (wihtout any mistakes)- I get "script upload success"
I always put at end of script line to remove itself and this is confirmation for me the error not exist and last self destruction was done. This remove old .log who have old errors as regex script.auto* .
.
/delay delay-time=2s;
/file remove [find name~"script.auto"];
/put "TheEnd";
.
.
I want to get the errors to be wriiting also to the files if there is a problem
I just use /put in script body in some lines like chapters, this is printed in script.auto.log file and I can assume at what part error happens. You can put blocks of code into :do={} on-error={put "error1"} to have errors only if he exist.
.
put "Starting..."
put "Doint clean up..."
put "Starting action..."
put "The End..."
.
for example file mp_ntp.auto.rsc have body:
.
/put "Starting..."
/system clock set time-zone-name=Europe/Warsaw
/system ntp client set enabled=yes primary-ntp=[:resolve tempus1.gum.gov.pl] secondary-ntp=[:resolve tempus2.gum.gov.pl]
/put "Done";
/delay delay-time=2s;
/file remove [find name~"mp_ntp.auto"];
/put "TheEnd";