Date: Sun, 27 Jan 2013 09:46:51 +0000 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: "W. D." <WD@US-Webmasters.com> Cc: freebsd-questions@FreeBSD.org Subject: Re: Cronjob Cvsup -> What? Message-ID: <5104F78B.8050408@infracaninophile.co.uk> In-Reply-To: <20130127001805.97F0119B@hub.freebsd.org> References: <20130127001805.97F0119B@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WQVKPAXWIPGSTFCLPLWC Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 27/01/2013 00:11, W. D. wrote: > What would be the best Cron command to keep ports updated on a daily > basis? Try this as a crontab entry: 0 3 * * * * /usr/sbin/portsnap cron update Two points to note: 1) The 'cron' verb is important for anyone setting up an automated job like this. It causes portsnap to wait for a random number of seconds (but less than 1 hour) before connecting to the portsnap server. Since the tendency is for people to schedule cron jobs to happen on the hour, this helps to avoid everyone connecting at once and smooths out the server load. 2) This assumes that you have previously run portsnap fetch extract to get yourself a portsnap-ready copy of the ports tree. You only need to do that once, but you should move aside any pre-existing copy of /usr/ports obtained by any means other than portsnap(8) before you do (but keep anything under /usr/ports/distfiles and maybe /usr/ports/packages). Something like: cd /usr mv ports ports.old mkdir ports mv ports.old/distfiles ports/distfiles mv ports.old/packages ports/packages portsnap fetch extract Although this may be complicated if any of /usr/ports, /usr/ports/distfiles or /usr/ports/packages are on a separate partition or ZFS. I say 'move aside' due to the caution imbued by having been a professional sysadmin for more years than I care to remember. If you are still convinced of your own infallibility, then you might find rm(1) an acceptable alternative. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey JID: matthew@infracaninophile.co.uk ------enig2WQVKPAXWIPGSTFCLPLWC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlEE94sACgkQ8Mjk52CukIxr3wCfa41q/s6KlUgCXy0MaSHWI37w xoQAn1zmH5/O7TiRncDM/jb0Z22nApd9 =1pSj -----END PGP SIGNATURE----- ------enig2WQVKPAXWIPGSTFCLPLWC--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5104F78B.8050408>