aco
July 3, 2009, 9:03am
1
Hi,
In order to update dynamic IP address with changeip I have to log in into my ROS and run the script manual by running winbox command “Run Script”.
I have followed wiki examples:
http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_ChangeIP.com
Can somebody please explain how can I make the the script to run automaticly every 3 hours without loging into ROS by winbox and running the command “Run Script” manualy?
Thank you
Alex
mrz
July 3, 2009, 10:23am
2
aco
July 3, 2009, 10:32am
3
I already have system scheduler and it looks like this:
[admin@MT ADSL] system> scheduler
[admin@MT ADSL] system scheduler> print
Flags: X - disabled
NAME ON-EVENT START-DATE START-TIME INTERVAL RUN-COUNT
0 ddns_update ddns startup 3m 1931
Below is the ddns script:
0 name="ddns_update" owner="admin" policy=ftp,reboot,read,write,policy,test,winbox,password
last-started=jul/03/2009 03:27:16 run-count=15 source=
:log info "DDNS: Begin"
:global ddns-user "XXXX"
:global ddns-pass "XXXX"
:global ddns-host "*1"
:global ddns-interface "pppoe-out1"
:global ddns-ip [ /ip address get [/ip address find interface=$ddns-interface] address ]
:if ([ :typeof $ddns-lastip ] = nil ) do={ :global ddns-lastip 0.0.0.0/0 }
:if ([ :typeof $ddns-ip ] = nil ) do={
:log info ("DDNS: No ip address present on " . $ddns-interface . ", please check.")
} else={
:if ($ddns-ip != $ddns-lastip) do={
:log info "DDNS: Sending UPDATE!"
:log info [ /tool dns-update name=$ddns-host address=[:pick $ddns-ip 0 [:find $ddns-ip "/"] ] k>
WHAT AM I MISSING???
mrz
July 3, 2009, 12:10pm
4
RUN-COUNT 1931
it means that scheduler is running and script was executed 1931, so where is the problem?
aco
July 3, 2009, 3:32pm
5
Well the problem is that the IP address is not beeing updated unless I hit “Run Script” from winbox or sometimes I have to open the script hit “Apply” and than “RunScript”. After that the number indicating script “Run Count” will increase.
“Run count” numbers do not mach between script and scheduler.
Script “Run Count Number” says: 15
Scheduler 'Run Count Number" says 1931
Aren’t they should have same value???
Thank you
Alex
Place the DDNS script in a ‘script’… then schedule that script to run. Don’t put the entire script into the scheduler.
hmmm… maybe it’s something to do with scheduler policy?..