Community discussions

MikroTik App
 
Arco van Bezooijen
newbie
Topic Author
Posts: 32
Joined: Sat Feb 05, 2005 1:33 pm
Location: The Netherlands
Contact:

schedule/script doesn't work after reboot

Fri Sep 30, 2005 10:10 pm

Hi there,

I someone could help me out...

I have a script running on all of my ap-bridges, that checks if the wireless interface is running every 5 minutes. Don't ask me why ;) sometimes a wifi interface stops running for a reason, and the only thing to do is disable and enable the interface to let it come up again...

The problem is that i schedule this script in the scheduler every 5 minutes, and works great. BUT ... when when I reboot the ap-bridge the script doesn't run anymore. I have to change the date and time manually for each schedule to let it work again. Ofcourse this is a 2 minute job, but I want to let the schedule do his job automatically after a reboot.

I use a public time server on every ap-bridge. is this the problem? when the ap-bridge has been reset, it uses the time and date 1 jan 2000 for some seconds, and then 'reset's to the actual time and date.

I hope someone can help me out with this. I use versions 2.8.20 untill 2.8.28 on several ap-bridges.

thanks in advance,

arco
 
rui
just joined
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Tue Oct 04, 2005 12:14 pm

I have tried some combinations on 2.8.28 :

If the system time is before the sheduled time, changing the system time won't help. It seems the system time has to "pass" the time the scheduler is set to to invoke it.

Try this:
Set the time the scheduler is to start to a time you know is earlier than the system time will be on boot e.g. Jan/01/1970. The system time will now be later than the time set for the scheduler and the script will run no matter what the system time is at boot.

I think ...

regards
rui :-)
rui
 
User avatar
GWISA
Member
Member
Posts: 394
Joined: Tue Jan 31, 2006 2:37 pm
Location: Johannesburg, South Africa

Thu Mar 16, 2006 10:46 am

Has anyone confirmed this workaround? Only problem is that different OS releases have different startup times (I seem to remember) so what date do you use? Early as possible?

We also have the same problem - scheduled scripts do not work after a reboot, and only by changing the start date/time to start after the current NTP time will it start again...
 
mosesjere
just joined
Posts: 7
Joined: Thu Sep 15, 2005 4:13 pm

Fri Mar 17, 2006 2:42 pm

I experience the same too. Am using v2.9.14
 
rui
just joined
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Fri Mar 17, 2006 3:15 pm

I might have misunderstood your problem, but since the earliest date I can set on the system is jan/01/1970 00:00:00, then any time that the system will have after a reboot is later than this time.

From this follows that the scheduler will start any scripts scheduled before the actual system time. Hence the script will be run at startup since the system time can not be earlier than jan/01/1970 ???

So I made a script with name script1 and then added the script to the scheduler to be run at jan/01/1970 at 00:00:00.

I have tried it on 2.8.28 and on 2.9.10.

rui
rui
 
rui
just joined
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Fri Mar 17, 2006 3:21 pm

I haven't tried it with NTP though. If this creates any problem after reboot I haven't tried that.

rui
rui
 
User avatar
GWISA
Member
Member
Posts: 394
Joined: Tue Jan 31, 2006 2:37 pm
Location: Johannesburg, South Africa

Fri Mar 17, 2006 3:42 pm

NTP doesn't help - and only really necessary on the RB 500's, as there is no CMOS battery. RB230 seems to be ok...

It seems that after a reboot of RB500, the time resets to the default, then synchs with NTP and the scheduler original start time is then before the current time (NTP synch), so it never starts again...

Maybe if you set the start time to be the same as the RB500 default, then the scheduler might run at the time of booting, but this is a headache on many routers that get upgraded periodically, as the default time changes with each revision...

Also, I have a few scheduled scripts that need to run at different times - eg backup, email backup then reboot... if I set the scheduler to run at the system startup time, then the router will be locked into an infinite reboot loop...
 
rui
just joined
Posts: 7
Joined: Wed Mar 23, 2005 10:10 am
Location: Horten, Norway

Fri Mar 17, 2006 4:00 pm

Anyway ...

My system starts with a system time later than the scheduled time and the script starts after reboot ;-)

rui
rui
 
MICPROF
Member Candidate
Member Candidate
Posts: 106
Joined: Thu Jan 27, 2011 7:22 pm
Contact:

Re: schedule/script doesn't work after reboot

Thu Mar 17, 2011 8:23 pm

im used script and schu but not work and return to default time , coz the ap-bridge don't have NAT to Service over the Internet , so don't good this script , you want to work that , do manually reboot the ap-bridge every day ...
Thanks!

Best Regards.


--------------------
If my answer helped you and my question good too, please give me karma

Who is online

Users browsing this forum: Google [Bot] and 17 guests