eworm-de / routeros-scripts

a collection of scripts for MikroTik RouterOS
GNU General Public License v3.0
1.27k stars 285 forks source link

check-routeros-update and other similar scripts suggested scheduler time #56

Closed bubenkoff closed 7 months ago

bubenkoff commented 7 months ago

In the check-routeros-update script's docs, it's suggested to use the 'startup' time of the script to be scheduled. For such actions, it seems more logical to schedule it at night instead, as the update shouldn't normally happen in the busy time.

eworm-de commented 7 months ago

The primary intend here is to notify the user on update. If device is configured to install updates automatically it may make sense to schedule at night. You are free to change that to your needs.

bubenkoff commented 7 months ago

Still IMO changing the suggested time to the night would serve both purposes just fine.

On Thu, Jan 25, 2024 at 4:52 PM Christian Hesse @.***> wrote:

The primary intend here is to notify the user on update. If device is configured to install updates automatically it may make sense to schedule at night. You are free to change that to your needs.

— Reply to this email directly, view it on GitHub https://github.com/eworm-de/routeros-scripts/issues/56#issuecomment-1910485035, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIJAAMN5BAQVMN7XRHBFTYQJ5SNAVCNFSM6AAAAABCKXT2S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJQGQ4DKMBTGU . You are receiving this because you authored the thread.Message ID: @.***>

eworm-de commented 7 months ago

Hmm, we have a mechanism to schedule the reboot at night... Perhaps we should just add a confirmation option to always schedule the reboot on automated update?

bubenkoff commented 7 months ago

Do you mean to schedule it with this change, instead of directly rebooting?

On Thu, Jan 25, 2024 at 4:55 PM Christian Hesse @.***> wrote:

Hmm, we have a mechanism to schedule the reboot at night... Perhaps we should just add a confirmation option to always schedule the reboot on automated update?

— Reply to this email directly, view it on GitHub https://github.com/eworm-de/routeros-scripts/issues/56#issuecomment-1910491051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIJACZDUGPPFNVCCLVDMTYQJ56LAVCNFSM6AAAAABCKXT2S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJQGQ4TCMBVGE . You are receiving this because you authored the thread.Message ID: @.***>

eworm-de commented 7 months ago

Yes. Packages are installed immediately, and reboot is scheduled if configured - just like you do when running packages-update interactively from terminal.

There is another reason I want the check to be scheduled after startup: I want to avoid making all devices in a network to download the packages at the exact time. Scheduling that way is easy to achieve it.

bubenkoff commented 7 months ago

Ok, thanks for the clarification. I think it makes a lot of sense to implement it this way indeed.

On Thu, Jan 25, 2024 at 5:24 PM Christian Hesse @.***> wrote:

Yes. Packages are installed immediately, and reboot is scheduled if configured - just like you do when running packages-update interactively from terminal.

There is another reason I want the check to be scheduled after startup: I want to avoid making all devices in a network to download the packages at the exact time. Scheduling that way is easy to achieve it.

— Reply to this email directly, view it on GitHub https://github.com/eworm-de/routeros-scripts/issues/56#issuecomment-1910549178, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIJAGPV73SOVSYA7EJAALYQKBLXAVCNFSM6AAAAABCKXT2S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJQGU2DSMJXHA . You are receiving this because you authored the thread.Message ID: @.***>

eworm-de commented 7 months ago

Pushed changes to the next branch... Do you want to give it a try?

bubenkoff commented 7 months ago

Yes, please!

On Fri, Jan 26, 2024 at 9:28 AM Christian Hesse @.***> wrote:

Pushed changes to the next branch... Do you want to give it a try?

— Reply to this email directly, view it on GitHub https://github.com/eworm-de/routeros-scripts/issues/56#issuecomment-1911661831, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIJADMGM7RWPPRXRRSQP3YQNSLLAVCNFSM6AAAAABCKXT2S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGY3DCOBTGE . You are receiving this because you authored the thread.Message ID: @.***>

bubenkoff commented 7 months ago

But what's the process of trying it then?

On Fri, Jan 26, 2024 at 11:10 AM Anatoly Bubenkov @.***> wrote:

Yes, please!

On Fri, Jan 26, 2024 at 9:28 AM Christian Hesse @.***> wrote:

Pushed changes to the next branch... Do you want to give it a try?

— Reply to this email directly, view it on GitHub https://github.com/eworm-de/routeros-scripts/issues/56#issuecomment-1911661831, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIJADMGM7RWPPRXRRSQP3YQNSLLAVCNFSM6AAAAABCKXT2S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGY3DCOBTGE . You are receiving this because you authored the thread.Message ID: @.***>

bubenkoff commented 7 months ago

@eworm-de the router got autoupdated last night, and the :global PackagesUpdateDeferReboot true; in the config didn't seem to defer the upgrade, it seemed to reboot right away when the script was scheduled (2 am). Is it a good idea to add some logging so that we can see that the defer really happens?

eworm-de commented 7 months ago

There is logging, it gives something like:

script,info packages-update: Scheduled reboot for update at 03:25:44 local time (Europe/Berlin).

And it works for me.

bubenkoff commented 7 months ago

Ok thanks, maybe I've missed it indeed, as I only have a memory log there. I think I'll add packages-update to the log forwarding to monitor it better.