Community discussions

MikroTik App
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Scheduled script won't run

Wed Apr 12, 2006 4:58 pm

Is MT going to do anything to fix the problem with scheduled scripts on reboot and the use of NTP?

I cannot get my scheduled scripts to work after reboot either, and I have multiple routers deployed that get rebooted regularly and manually resetting the start time on each script in each router is just plain silly...

I guess until this is fixed, I need to not use NTP? Can anybody think of a better idea at this point. Please advise. Thanks
 
User avatar
djape
Member
Member
Posts: 465
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Wed Apr 12, 2006 5:45 pm

Same thing here, I'm having problem with NTP and schedulles.
Not firewalled but still not updating time, making problem to schedulles.
Generally it wouldn't be a problem but rb532 after each reboot resets the time...
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Wed Apr 12, 2006 7:42 pm

Ok, I just decided to set all of my scripts to start-date=dec/31/1970

I works, and I see no other way at this point. Any better ideas?
 
User avatar
djape
Member
Member
Posts: 465
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Fri Apr 14, 2006 3:51 pm

Ok, I just decided to set all of my scripts to start-date=dec/31/1970
Yes but I have problem with time, for date I don't care. I have scripts that needs to run on specific time of the day and now I have problem doin' it manually :(

Cheers...
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Fri Apr 14, 2006 11:08 pm

I am trying something which may work, and I will let you know if it works for me. Since scripts which run often (like every minute) run no matter what time of day the router has, the following script will run every minute, and if the router has recently rebooted, it will remove a scheduled script and write it again in the scheduler. Therefore, the script should run on time the next time it is called. After the schedule is rewritten, the script no longer rewrites the schedule again even though it checks every 1m to see if it need to rewite them. The example is below.
/system scheduler add name=reset-script1 interval=1m start-date=dec/31/1970 on-event={:if ($a <= 1) do {/sys sch rem [/sys sch find name=scriptname]; /sys sch add name=scriptname interval=24h start-date=dec/31/1970 start-time=4:00:00 on-event=ebackup disabled=no}; :global a ($a+1)} disabled=no
The scheduled script should be successfully rescheduled for 4am. I am testing it now. Let me know if you have any feedback.
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Sat Apr 15, 2006 11:40 am

djape: It looks like my timed scripts are working ok. I had an event ,which is set to run at 3am every morning, and it just ran a few minutes ago at 3am. So I guess the work around I posted above actually works. Let me know if it helps you too. :D
 
User avatar
djape
Member
Member
Posts: 465
Joined: Sat Nov 06, 2004 7:54 pm
Location: Serbia

Mon Apr 17, 2006 5:05 pm

In my case scheduller will show count as everything is ok, but never executes....
This happened from 2.9.17 and even now on 2.9.20 is the same. Yesterday I did system reset and did router from the begining, still the same...
It's simple p2p connection script to enable and disable firewall rule.
Main problem is that ntp client sometimes picks the time and sometime don't.
No firewall rules to drop ntp traffic...
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Mon Apr 17, 2006 8:59 pm

That is interesting. I have all of my rb532a running 2.9.18 and one running 2.9.20 and the workaround I recommended seems to be working very well. I actaully have the router also rebooting itself every night, and then after reboot it resets the scripts and then executes flawlessly. The only problem I have encountered is when script try to execute at the same time, they wont work.

Who is online

Users browsing this forum: No registered users and 65 guests