From owner-freebsd-questions@FreeBSD.ORG Fri Aug 29 14:20:43 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC21DE04 for ; Fri, 29 Aug 2014 14:20:43 +0000 (UTC) Received: from navy.spectrumcs.net (navy.spectrumcs.net [109.169.26.118]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2AD12D3 for ; Fri, 29 Aug 2014 14:20:43 +0000 (UTC) Received: from localhost (maroon.spectrumcs.net [10.8.0.9]) by navy.spectrumcs.net (Postfix) with ESMTP id 3hl2xc0bDTz13cJ; Fri, 29 Aug 2014 15:19:32 +0100 (BST) X-Virus-Scanned: amavisd-new at spectrumcs.net Received: from rainbow.spectrumcs.net (rainbow.spectrumcs.net [81.133.126.70]) by maroon.spectrumcs.net (Postfix) with ESMTPS id 3hl2xY2zV4z6lxT; Fri, 29 Aug 2014 15:19:29 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spectrumcs.net; s=scs; t=1409321969; bh=pdPiHY7e10w5FjNU1mEWQUOVbDtVNgmDHQUDK2SAxnY=; h=From:Subject:Date; b=sAKIAla5r6X21tjmlQUPlHulIHFtoewnNdTSQkJnznROGH59cUQhy3GZwyVyizYTo bRIBW8quDK1WtdsQulsTc+XJ+KRMpY8hVxEGwjh/Lp9bmRfKRkihQiMHwRyAQjWHL7 OxzYw/Byg0MC7ydld22XC8VKe4JrDlsF0Cn24s3s= From: "steve" Subject: Re-2: Ports question .... To: "Arthur Chance" , "William A. Mahaffey III" , "FreeBSD Questions !!!!" Date: Fri, 29 Aug 2014 14:19:29 +0000 Priority: normal X-Priority: 3 (Normal) Importance: normal X-Mailer: David.fx by Tobit.Software, Germany (0397.464448464547484D524D), Mime Converter 101.20 X-David-Sym: 0 X-David-Flags: 0 Message-ID: <0000BD3F.54009A01@rainbow.spectrumcs.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Aug 2014 14:20:43 -0000 -------- Original Message -------- Subject: Re: Ports question .... (29-Aug-2014 14:45) From: Arthur Chance 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.