# Improving my update script



## realtime (Jan 12, 2013)

I'm looking for comments / suggestions to improve my general updating script. Its purpose is to maintain system updates, ports, 3rd-party, keep things clean and well behaved.

Manual verification of /usr/ports/CHANGES is, well, manual.  I also diff the ports list output just to report any updates upon completion, if I wasn't paying attention (or a 100 minute gcc recompile happens). Beyond this, what could be improved with the following script? Have I missed any obvious key FreeBSD related updates? Should commands be reordered?


```
#!/bin/bash

mv ~/portupdates/ports.current ~/portupdates/ports.last

freebsd-update fetch install
pkgdb -LFa
portsnap fetch update
portupgrade -aD
portsclean -C -D -DD

gem update

portmaster -l > ~/portupdates/ports.current
```


----------



## wblock@ (Jan 12, 2013)

portsnap(8) downloads the index file also.  So move the pkgdb command after it, and remove -F.


----------



## realtime (Jan 13, 2013)

Looks good, thanks for the info. Staying updated is easy now!


----------

