script not starting on startup ver 3.9

Hi guys

I upgraded to 3.9 last night and since then I’m battling to get scripts to start on start-up. They eventually go through after the first interval period, but no on startup.

I’ve attached some graphics.

Any pointers please?

I’ve deleted the scripts then recreated (via copy and paste) and I’ve even deleted and recreated the schedules but to no avail.
scripts_startup.JPG
script_after5.JPG

This is strange. It works for me on routerboard and x86.
Have you tried setting delay at the beginning of script?

sorry forgot to mention this is on a x86 that was upgraded from 3.7 to 3.9 yesterday.

I’ll try the delay option. just need to get out the script notes.

ok I added a ‘:delay 1m’ to the start of the script which DOES delay the running of the script by one minute. I then rebooted the box but alas the script did not run until the first interval period was over. So in other words it didn’t even run after one minute’s delay.

any other pointers? maybe it’s a 3.9 ‘feature’ :slight_smile:

I havent upgraded scripts to 3.9 yet but will test our ddns one. It might be that the script isn’t liked ?

Also, you can change the scheduler from startup to 00:00, if its interval is every 5 mins then it should just run every 5 mins, as long as its after midnight ?

Sam

Sam, the script runs, just not on start-up. So it waits the first five minutes and then chugs along as expected.

Sam, here is my script nevertheless;


:delay 1m
:global ddnsuser “myname”
:global ddnspass “mypass”
:global ddnshost “myddns.dynamic-dns.net
:global ddnsip
:global ddnslastip [:tostr [:resolve $ddnshost] ]
:if ([ :typeof $ddnslastip ] = nil ) do={ :global ddnslastip “0” }
:global ddnsinterface “adsl_pppoe”
:global ddnssystem (“mt-” . [/system package get system version] )

:local int

:local ddnsipfn [ /ip address get [/ip address find interface=$ddnsinterface ] address ]
:global ddnsip [:pick $ddnsipfn 0 [:find $ddnsipfn “/”]]

:if ([ :typeof $ddnsip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddnsinterface . “, please check.”)
} else={

:if ($ddnsip != $ddnslastip) do={

:log info “DDNS: Sending ADSL UPDATE!”
:log info [ :put [/tool dns-update name=$ddnshost address=$ddnsip key-name=$ddnsuser key=$ddnspass ] ]
:global ddnslastip $ddnsip

} else={
:log info “DDNS: No ADSL update required.”
}

}


Perhaps it’s not completely compatible?

Ok I asked support what was causing this and they said “If scheduler have both interval and start-time=startup set then script will not be executed at startup. It was made to work that way.”.

So what I’ve done is create two scheduler items for the DDNS, once to run on start-up and then another for the interval period count.

So there you have it.