This login-logout hook pair and launch agent help manage the disk space in various computing classrooms on campus, by deleting older home directories when the system starts running out of space.
-
Out of the box, this uses a login/logout hook pair that we run under a hook "master" script. You can use some other strategy depending on your environment.
-
Configure max time-to-keep and a disk size threshold in
/etc/homedir.defaults
(and a per-machine override file,/etc/homedir.defaults.local
) -
The main script,
HomeDirReaper.sh
, calls two helpers,list-local-users
andhome-directory-for-user
. We have these on all our systems with our other tools; I've provide x86 binaries in thebin
folder. Source for both will be on GitHub ASAP.
This should be sufficient:
- Install ruby - rbenv and ruby-build are handy.
bundle install
bundle exec ./build-munki-dmg.rb
- You will have a
UserHomeDirManagement-numbers.plist
and.dmg
ready to deploy.
make
- You will end up with a
UserHomeDirManagement.pkg
to deploy.
preinstall.sh
: Older versions of this tool would move directories in to and out from a folder named/Users/.old
, but this has caused a number of issues, including a dock that is missing all its icons. The current version instead hides and unhides the user's directory, rather than moving it around.Gemfile
andGemfile.lock
are used by Rubybundler
.