On 29.08.2019 01:59, Steven Shockley wrote:
> So, many thanks to everyone who put together the new -stable updates for
> packages.  Is there a command I can put in the crontab that will only
> output if there are updates?  Similar to what syspatch or openup does.
> I tried pkg_add -unx, but that still tells me to delete old files and
> prints the quirks line even if there are no updates.

Hi Steven,

here's what I came up with in my /etc/daily.local file...

(pkg_add -suv | sed -En 's/^Adding (.+)\(pretending\)/\1/p') 2>&1 \
    | grep -v ': Requesting'

Initially I didn't use the verbose option and a simpler sed expression,
but I eventually found that pkg_add's output differs whether a terminal
is attached or not. So that's what works for me.

Regards
Andre

Reply via email to