Community discussions

MikroTik App
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

script won't run on scheduler?

Sun Sep 10, 2017 5:31 pm

Hello ,
I have a strange problem -
I have a script that run jsut fine from terminal
but when I put him in scheduler it does nothing
I can see the scheduler run count +1 but the script is running

what could be the reason for it?
 
User avatar
jspool
Member
Member
Posts: 472
Joined: Sun Oct 04, 2009 4:06 am
Location: Oregon

Re: script won't run on scheduler?

Mon Sep 11, 2017 5:35 am

Have you tried putting this into the scheduler field instead of just the script name?

/system script run myscript
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1658
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: script won't run on scheduler?

Mon Sep 11, 2017 9:39 am

Are you sure that Scheduler has the same or more policies enabled than the script?
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: script won't run on scheduler?

Mon Sep 11, 2017 12:24 pm

now after I write in the scheduler
/system script run myscript

it is working

what is the different?
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1658
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: script won't run on scheduler?

Tue Sep 12, 2017 4:53 pm

Did you have multiple scripts on this device? Is it possible that they had similar names?
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: script won't run on scheduler?

Wed Sep 13, 2017 2:44 pm

No multiple scripts on this device ,
I have also try to change the name - stil the same ...

strange
 
User avatar
Steveocee
Forum Guru
Forum Guru
Posts: 1189
Joined: Tue Jul 21, 2015 10:09 pm
Location: UK
Contact:

Re: script won't run on scheduler?

Wed Sep 13, 2017 3:22 pm

Silly of me to ask but your router does have the correct time? Have had a similar issue when I didn't set SNTP to a router once and it too didn't run scripts at the correct time.
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: script won't run on scheduler?

Thu Sep 14, 2017 12:13 pm

I thought about it also - :-)
the time is correct
 
User avatar
strods
MikroTik Support
MikroTik Support
Posts: 1658
Joined: Wed Jul 16, 2014 7:22 am
Location: Riga, Latvia

Re: script won't run on scheduler?

Thu Sep 14, 2017 12:30 pm

If clock would affect this, then behavior would not differ between specifying script name or full script launch command.

Please provide precise export of:
1) Script;
2) Scheduler which works;
3) Scheduler which does not work.
 
MedVed01
just joined
Posts: 3
Joined: Thu Oct 20, 2016 10:22 pm

Re: script won't run on scheduler?

Sun Oct 08, 2017 10:15 pm

Hi,
please check policy in scheduler and on script. The policies in scheduler must be same or greater than on script.
MV.
 
rogers3b2
just joined
Posts: 5
Joined: Thu Nov 23, 2017 7:30 pm

Re: script won't run on scheduler?

Sun Jan 07, 2018 6:41 pm

I too facing similar issues in hotspot user profile logout . I am firing some url on logout . some time script executes some times not .
very strange behaviour . In some version of Mikrotik it work ok .but this issue is there. There is no gurantee that script will execute on time .
Hope mikrotik see this issue in detail.
 
User avatar
ADahi
Member Candidate
Member Candidate
Posts: 209
Joined: Thu Sep 21, 2017 7:16 pm
Location: Iraq, Ninavah
Contact:

Re: script won't run on scheduler?

Sun Jan 07, 2018 6:45 pm

put whole script inside { }
 
SfieszaQ
just joined
Posts: 6
Joined: Tue Jul 06, 2021 12:26 am

Re: script won't run on scheduler?

Sat Sep 04, 2021 11:28 pm

I have created script MQTT and schedule MQTT and had same issue.
When I changed both on mqtt it started working.
I think that key words should not been used.
 
mladen074
just joined
Posts: 8
Joined: Mon Nov 27, 2017 3:54 pm

Re: script won't run on scheduler?

Sat Apr 30, 2022 10:25 am

deleted post
Last edited by mladen074 on Sat Apr 30, 2022 10:38 am, edited 1 time in total.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12554
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: script won't run on scheduler?

Sat Apr 30, 2022 10:34 am

Inside the scheduler you can put directly the script.
Why inside scheduler put a script that launch another script?
 
mladen074
just joined
Posts: 8
Joined: Mon Nov 27, 2017 3:54 pm

Re: script won't run on scheduler?

Sat Apr 30, 2022 10:37 am

Maybe the documentation could be updated https://wiki.mikrotik.com/wiki/Manual:System/Scheduler because there, it reads: on-event (name) - name of the script to execute. It must be presented at /system script
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12554
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: script won't run on scheduler?

Sat Apr 30, 2022 10:43 am

Is old documentation, from v4 on 2008...

Who is online

Users browsing this forum: garyjduk, mukkelek, vingjfg and 27 guests