Date: Fri, 29 Aug 2014 14:19:29 +0000 From: "steve" <freebsd-questions@spectrumcs.net> To: "Arthur Chance" <freebsd@qeng-ho.org>, "William A. Mahaffey III" <wam@hiwaay.net>, "FreeBSD Questions !!!!" <freebsd-questions@freebsd.org> Subject: Re-2: Ports question .... Message-ID: <0000BD3F.54009A01@rainbow.spectrumcs.net>
next in thread | raw e-mail | index | archive | help
-------- Original Message --------
Subject: Re: Ports question .... (29-Aug-2014 14:45)
From: Arthur Chance <freebsd@qeng-ho.org>
To: freebsd-questions@spectrumcs.net
> On 29/08/2014 13:59, William A. Mahaffey III wrote:
> [huge snip]
>=20
> > I have been using portsnap, I just couldn't figure out how to get it =
to
> > tell me what ports had been updated since I last fetched (w/o =
fetching
> > again) ....
>=20
> It's my experience that you don't want to be told which ports have been =
> updated, as most updates are to ports you're not the slightest bit=20
> interested in. There are nearly 25,000 ports according to FreshPorts and =
> I personally have only about 400 installed on my desktop machine (and=20
> far fewer on my servers). That means on average I'm totally uninterested =
> in 98+% of all port updates.
>=20
> What you need to know is what *installed* ports are out of date with=20
> respect to the new ports tree. That's where the 400.status-pkg periodic =
> script is useful. I update my ports tree via a crontab entry at 23:00 on =
> Fridays, and the weekly periodic script runs at 4:15 on Saturday, so I=20
> get mail every Saturday morning telling me which installed ports are out =
> of date.
For what it's worth I have two scripts I've created.
# ll /usr/local/sbin/scs-check-for-*
/usr/local/sbin/scs-check-for-ports-updates-cron.sh
/usr/local/sbin/scs-check-for-ports-updates.sh
# less /usr/local/sbin/scs-check-for-ports-updates-cron.sh
#!/bin/sh
/usr/sbin/portsnap cron update && /usr/sbin/pkg version -vIL=3D
# less /usr/local/sbin/scs-check-for-ports-updates.sh
#!/bin/sh
/usr/sbin/portsnap fetch update && /usr/sbin/pkg version -vIL=3D
read -r -p "Press Enter key to continue..." key
less /usr/ports/UPDATING
and then I have a symlink set to call the cron version on a daily basis.
ll /etc/periodic/daily/*scs-check-for-ports*
lrwxr-xr-x 1 root wheel 51B Jan 14 2013 =
/etc/periodic/daily/610.scs-check-for-ports-updates-cron.sh -> =
/usr/local/sbin/scs-check-for-ports-updates-cron.sh
The use of the cron command vs a simple fetch means portsnap waits a =
random time between 0 and 3600 seconds (1 hour) before fetching. This =
helps to prevent everyone hitting the port tree servers at exactly the =
same time (usually we admins cron on the hour).
# portsnap
usage: portsnap [options] command ... [path]
Options:
-d workdir -- Store working files in workdir
(default: /var/db/portsnap/)
-f conffile -- Read configuration options from conffile
(default: /etc/portsnap.conf)
-I -- Update INDEX only. (update command only)
-k KEY -- Trust an RSA key with SHA256 hash of KEY
-l descfile -- Merge the specified local describes file into the =
INDEX.
-p portsdir -- Location of uncompressed ports tree
(default: /usr/ports/)
-s server -- Server from which to fetch updates.
(default: portsnap.FreeBSD.org)
path -- Extract only parts of the tree starting with the given
string. (extract command only)
Commands:
fetch -- Fetch a compressed snapshot of the ports tree,
or update an existing snapshot.
cron -- Sleep rand(3600) seconds, and then fetch updates.
extract -- Extract snapshot of ports tree, replacing existing
files and directories.
update -- Update ports tree to match current snapshot, replacing
files and directories which have changed.
Because this script is cron daily in my "[HOSTNAME] daily run output" =
email I get every morning I see something like....
amavisd-new-2.8.0_2,1 < needs updating (index has 2.9.1,1)
syslog-ng-3.5.4.1 < needs updating (index has 3.5.6_3)
Regards
Scotter
To: freebsd@qeng-ho.org
wam@hiwaay.net
freebsd-questions@freebsd.org
DISCLAIMER
This email is for the use of the intended recipient(s) only. If you have =
received this email in error, please notify the sender immediately and =
then delete it.=20
If you are not the intended recipient, you must not keep, use, disclose, =
copy or distribute this email without the authors prior permission.=20
We have taken precautions to minimise the risk of transmitting software =
viruses, but we advise you to carry out your own virus checks on any =
attachment to this message.
We cannot accept liability for any loss or damage caused by software =
viruses.
The information contained in this communication may be confidential and =
may be subject to the attorney-client privilege.=20
If you are the intended recipient and you do not wish to receive similar =
electronic messages from us in future then please respond to the sender to =
this effect.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0000BD3F.54009A01>
