Skip to content

Instantly share code, notes, and snippets.

@stefanlasiewski
Created May 31, 2013 22:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanlasiewski/5688419 to your computer and use it in GitHub Desktop.
Save stefanlasiewski/5688419 to your computer and use it in GitHub Desktop.
Update MacPorts base to latest released version using 'selfupdate', Then upgrade all outdated ports (upgrade outdated), and uninstall old version of each port (-u)
#!/bin/sh
# Update MacPorts base to latest released version using 'selfupdate'
# Then upgrade all outdated ports (upgrade outdated), and uninstall old version of each port (-u)
# http://guide.macports.org/#using.common-tasks.updating
# http://guide.macports.org/#using.port.upgrade
# Can be called from Cron
################################################################################
ME=`basename $0`
doit () {
PATH=$PATH:/usr/local/bin
port selfupdate && \
port -u upgrade outdated
}
# Run command, and send logs to syslog
doit 2>&1 | /usr/bin/logger -t $ME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment