Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Oct 2005 11:31:11 +0300
From:      "Andrew P." <infofarmer@gmail.com>
To:        John DeStefano <john.destefano@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: portupgrade stale dependencies
Message-ID:  <cb5206420510310031y1a737888r97a81534d8f1b33b@mail.gmail.com>
In-Reply-To: <f2160e0d0510301818rdbc4f20t7f1704a93e8e8d29@mail.gmail.com>
References:  <f2160e0d0510151746n28cdbb25s2150337c0c6f7cfc@mail.gmail.com> <6FB767AE-D4D7-4C38-90C0-726D48AF5654@secure-computing.net> <f2160e0d0510281731u268c1f75y82ec93a0ed08ad40@mail.gmail.com> <200510281922.16495.ringworm01@gmail.com> <f2160e0d0510281951s541d3d9ft808d36b023fa9661@mail.gmail.com> <cb5206420510290423v4a107a5dl574ba5387a3424f2@mail.gmail.com> <f2160e0d0510301750p160696a8r3b20d07ac903a340@mail.gmail.com> <cb5206420510301800r29ab0681w56fc8e9ef24f72f5@mail.gmail.com> <f2160e0d0510301818rdbc4f20t7f1704a93e8e8d29@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/31/05, John DeStefano <john.destefano@gmail.com> wrote:
> On 10/30/05, Andrew P. <infofarmer@gmail.com> wrote:
> > On 10/31/05, John DeStefano <john.destefano@gmail.com> wrote:
> > > On 10/29/05, Andrew P. <infofarmer@gmail.com> wrote:
> > > > On 10/29/05, John DeStefano <john.destefano@gmail.com> wrote:
> > > > >
> > > > > Needless to say, this process wasn't much fun.  What can I do to =
keep
> > > > > this from happening again?  What can/can't I safely include in cr=
on to
> > > > > automate database and index maintenance?
> > > > >
> > > >
> > > > cvsup or portsnap, then portsdb -uUF. Work under
> > > > any circumstances, leave you with updated ports
> > > > tree and indexes.
> > >
> > > If I were to continue to use portsnap, which arguments can I safely
> > > add to /etc/crontab? I know "portsnap cron" should be safe, but if I
> > > want to completely automate the update process (not for installing
> > > packages, but for keeping the ports tree, database, and indexes
> > > current), should I also add an entry for "portsnap update" and
> > > "portsdb -uUF"?
> > >
> > > >
> > > > You can also try portupgrade -aF (prefetches
> > > > needed files to speed up manual upgrade at a later
> > > > time) and portsclean -DP (removes sources and
> > > > packages which become outdated due to ports
> > > > tree updates).
> > > >
> > >
> > > Would you also recommend cron entries for these two commands?
> > >
> > > I used to use a cron job to run cvsup, and I'd like to implement a
> > > better, more complete automated solution, so I don't tangle up my
> > > system's packages and dependencies again.
> > >
> >
> > I think the best way is to create a shell script, like this:
> >
> > #!/bin/sh
> > /usr/local/sbin/portsnap cron && \
> > /usr/local/sbin/portsnap update && \
> > /usr/local/sbin/portsdb -uUF && \
> > /usr/local/sbin/portupgrade -aF && \
> > /usr/local/sbin/portsclean -DP
> >
>
> Perfect... I had everything but the && conditionals... thanks!
>
> >
> > and run it at an hour, when you're most unlikely to
> > perform any kind of port upgrading. As portsnap
> > manpage warns, if both portsnap (in the process
> > of update) and portupgrade ever happen to access
> > the same directory at once, it might ruin your
> > ports tree. You'll have to do "portsnap extract"
> > after that. You can leave out portsclean and run
> > it manually, because it can create some load
> > (which is not desirable on a production server).
> >
> > I run this script daily at 8-9 in the morning (I usually
> > start messing with servers after 11). It never failed,
> > and it always keeps everything up-to-date.
> >
>
> My server is not "production", as it's just my personal web/database
> server; I'm the only one who would be running any updates.  So I
> should be okay with this procedure, and I'll manually update any ports
> of note.
>
> Just one problem I saw thus far, with portsclean I think...
>
> Cleaning out /usr/ports/packages...
> cd: can't cd to /usr/ports/packages/All
> find: /usr/ports/packages: No such file or directory
>
> Would this be related to one of the "advanced topics" you mentioned
> earlier about pkgtools.conf? ;)  Do I need to define some variables?
> I would guess the directory error to have been caused by a combination
> of the variables PORTSDIR (which looks okay at /usr/ports) and
> PACKAGES (which seems to need a /packages dir beneath PORTSDIR <?>).
>
> Thanks,
> ~John
>

No, it's not advanced at all :-) You just don't have the
directory. Create it, if you want to. When you run
"make package" or "portupgrade -p something", a
package is created in your current directory, unless
/usr/ports/packages exists. If it does, the package
is created there, and some hierarchy is kept, too.
So it's convenient to have that dir, if you ever use
packages.

Of course, /usr/ports/packages is just the default.
You can change "PACKAGES" to whatever you like.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cb5206420510310031y1a737888r97a81534d8f1b33b>