Christoph Kukulies via macports-users <[email protected]> wrote:

> Nearly everytime when I'm using macports I'm asked to do a port selfupdate. 
> To avoid this, I'd like to register a cron job that does the selfupdate - 
> maybe once a week or
> if it doesn't cost much, every day?.
> Has anyone done so? It should run from root, shouldn't it?

I haven’t personally scheduled updates, but that should be possible. You should 
be able to use cron, although Apple considers that deprecated in favor of 
launchd / launchctl. See 
https://alvinalexander.com/mac-os-x/mac-osx-startup-crontab-launchd-jobs/ for 
instance.

You’ll need to use port's -N flag for non-interactive mode, to avoid 
interactive questions which you won’t be able to answer when running as a 
scheduled task.

And yes, the scheduled task should run as the user that you’d use when running 
the task manually, which is typically root for the MacPorts upgrade command.

Nils.

Reply via email to