DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th June 2018
bsdsource bsdsource is offline
Port Guard
 
Join Date: Apr 2014
Posts: 34
Default syspatch cron job

I would like to check for any new patches daily at 3:00 am using syspatch and update my system if there are any new patches. If are new patches I would like to install them and then reboot my system. Anyone have a cron job script or anything that would accomplish this task?
Reply With Quote
  #2   (View Single Post)  
Old 18th June 2018
beavers beavers is offline
Shell Scout
 
Join Date: Nov 2017
Posts: 85
Default

I think the general wisdom is that you should be present for updates in case something unexpected happens, but you could certainly check for updates by adding this to root's tab:

Code:
0 3 * * *	/usr/sbin/syspatch -c
syspatch(8) even mentions this very use case. Otherwise if you're dead set on applying the updates unattended, it doesn't have to be any more complicated than:

Code:
0 3 * * *	/usr/sbin/syspatch && /sbin/reboot
Reply With Quote
  #3   (View Single Post)  
Old 20th June 2018
bsdsource bsdsource is offline
Port Guard
 
Join Date: Apr 2014
Posts: 34
Default

I was aware of the syspatch -c command but it would seem the appropriate use for that command is for an admin who is present.

I'll probably just tinker with the syspatch script and change it to reboot my machine after patches are automatically installed using a cron job. Had to tinker with it before when I was unable to use syspatch on a dated nightly build installed release of OpenBSD.

Thanks for your input.
Reply With Quote
  #4   (View Single Post)  
Old 21st June 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

I use syspatch -c in daily.local(5) on all production servers. The output is empty except when a patch is available.
Reply With Quote
  #5   (View Single Post)  
Old 29th June 2018
bsdsource bsdsource is offline
Port Guard
 
Join Date: Apr 2014
Posts: 34
Default

Thanks for your alternative suggestion jggimi.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
syspatch on only two architectures? pawkolor OpenBSD General 9 22nd October 2017 05:39 PM
syspatch appears to get stuck Prevet OpenBSD Installation and Upgrading 1 9th October 2017 07:37 PM
cron newsyslog message starbuck FreeBSD General 2 6th August 2008 07:33 PM
Cron running but not working stukov Other BSD and UNIX/UNIX-like 26 24th July 2008 01:17 PM
Using sendmail in a cron job erehwon OpenBSD General 6 15th May 2008 09:03 PM


All times are GMT. The time now is 08:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick