scheduler script won't run , manual run O.K

Hello
I have this script that tell me if the IP of another router has been change

:global Old [/interface eoip get eoip-tunnel1 remote-address];
:global Router1 [/file get Router1.txt contents];
if ($Old !=$Router1) do={:log warning "The new IP for Router1 is-$Router1";/interface eoip set eoip-tunnel1 remote-address=$Router1} else={:log warning "Router1 didn't change"};

when I run it manually it work just fine
but when I press “RUN” or on schedule it doesn’t work (I always get “Router1 didn’t change” ).
even when I know for sure I have change the IP in the text

any idea why ?

Does the scheduller run this script, can you see run count ?

You can try to add some :delay in your scrept beginning.

I can see the script is running
but I always get the “else”
but if I take the same script and run it withing the terminal I get the right result.
I have try to use delay and put
“delay 1”
after every read of data - didn’t help