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

-- 
Dr Matthew J Seaman MA, D.Phil.

PGP: http://www.infracaninophile.co.uk/pgpkey
JID: matt...@infracaninophile.co.uk

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to