Hi all!
Pls help me with the an issue! ROs 5.18.
I need a script which would copy current (synchronized) time/date to default time/date on flash, that after reboot or power loss I have last right time. It saves my old graphs(all graphs before default time/date) from overwrite befor next ntp-synchronization.
I know that device could be off for an hour or even more and there would be some blanks after synchronization… Anyway it’s better than lose all graphs.
That script would set the correct time only after RouterOS is fully booted, and in that case, result would be the same as using NTP client on the router.
And what if after reboot there’s no Internet connection for 5 min more. In this case all graphs would be deleted.
Look close:
Let us pretend it’s “18:00, 06 august 2012” on my mikrotik. Than suddenly my ISP felt down. If I wouldn’t reboot mikrotik it will be ok, it still draws graphs even there’s no Internet connection because time is synchronized. But if I accidentally reboot my router and it couldn’t synchronize with ntp-server because of no Internet connection, in this case it kills all graphs. Time would be Jan/01/2002 and it deletes all graphs since this date. BUT if date would be “18:00, 06 august 2012” it leaves graphs untouched up to this date.
No No No! Here in Ukraine its very common situation
Our Electricity Company sucks!
They switch off electricity for half a day and no UPS could keep charge so long.
Or when ISP down some noobie user might reboot mikrotik just in case it helps.
I think making default time to be the same as current(synchronized) time is very clever solution!
Create this as a script and run it with a scheluder. This may be hard on the NAND, so schedule accordingly, but frequence will be the ‘precision’ of the saved clock.
+1
Quite a few things should get postponed until NTP is synchronised, e.g. I have often noticed that an IPSec VPN gets established before a response from NTP kicks in, so the tunnel has to get recreated after just a few seconds.