Cronjob Cvsup -> What?
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sun Jan 27 09:46:56 UTC 2013
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: matthew at infracaninophile.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 268 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20130127/420224be/attachment.sig>
More information about the freebsd-questions
mailing list