OPNsense Forum

English Forums => General Discussion => Topic started by: Greg_E on October 04, 2024, 09:39:50 PM

Title: Schedule OS updates for off hours?
Post by: Greg_E on October 04, 2024, 09:39:50 PM
Is there a way to schedule when an OS update can be done and automatically reboot when finished?

I've had the Business update waiting for me for about 2 weeks now, and no good time I can interrupt my users (stupid Adobe may close the projects if it loses constant connection).
Title: Re: Schedule OS updates for off hours?
Post by: Maurice on October 05, 2024, 02:03:40 AM
Yes, you can create a cron job (System: Settings: Cron).

Cheers
Maurice
Title: Re: Schedule OS updates for off hours?
Post by: erica.vh on October 05, 2024, 01:16:57 PM
Make sure your user are off during the automatic update
Taking your adobe example, if your user left it on, with a project ongoing , your update might make them lose some of it if not saved and closed ?

A network wide warning might be useful, the day before, and the very day, to tell user to save and close
Title: Re: Schedule OS updates for off hours?
Post by: Greg_E on October 10, 2024, 04:05:06 PM
OK, another stupid question. In the hours tab, it shows that I can set a time to start, I just want to make sure I don't cause a problem in the middle of the day.

I looked up the cron man pages, and on the crontab(5) it says that hours are 0-23, which makes sense and what I was looking for. But before I set this to enabled I want to make sure.

If I set the hour to 1 or 01, this is going to be 1:00 am, not 1:00pm (13:00), correct? I don't remember setting the system for 24 hour mode and don't see any checkbox to do this.
Title: Re: Schedule OS updates for off hours?
Post by: Maurice on October 10, 2024, 05:57:34 PM
cron always uses the 24-hour format, like any sensible person or system. 😁

Cheers
Maurice
Title: Re: Schedule OS updates for off hours?
Post by: Greg_E on October 10, 2024, 07:06:31 PM
Thanks, going to give it a try tonight and hope that I can fix any issues in the morning. Not really expecting anything drastic to be wrong, and Fridays we don't have classes so not a lot of student work happening first thing in the morning.
Title: Re: Schedule OS updates for off hours?
Post by: Greg_E on October 16, 2024, 03:53:05 PM
Thanks again, got things done and going forward tasks will be easier. My only wish would be to have a run once checkbox, especially for the reboot job since I generally only reboot when needed.
Title: Re: Schedule OS updates for off hours?
Post by: Maurice on October 16, 2024, 04:16:19 PM
You can (kind of) achieve this by setting the month and day of the month.
Title: Re: Schedule OS updates for off hours?
Post by: Greg_E on October 17, 2024, 04:24:28 PM
Thanks again, hadn't really thought of it that way. I'll look into longer term stuff, especially since there is another new update (Business license) that just hit today. I probably won't apply that update until next week.