home_cleaner deletes user directories on a Mac OS X computer when they are old enough and not blacklisted or not logged in. This can be useful for maintaining a pc lab.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
config
launchd
lib
test
.autotest
CHANGELOG.rdoc
LICENSE
README.rdoc
Rakefile
home_cleaner.gemspec

README.rdoc

DESCRIPTION

home_cleaner deletes user directories on a Mac OS X computer when they are old enough and not blacklisted or not logged in. This can be useful for maintaining a pc lab. Maybe you can achieve the same with UNIX find(1). The following could be sufficient:

% find /Users/* -maxdepth 0 -mtime +7 -type d -not -name Shared | xargs -n1 rm -rf

SYNOPSIS

% home_cleaner
clean(user1)
clean(user2)
remove /Users/user2
clean(admin)
clean(user3)
remove /Users/user3
...

REQUIREMENTS

Mac OS X and Ruby.

INSTALL

% gem install home_cleaner

If that fails you may have not the rights to install, try again using sudo. Update rubygems, if you get an error like:

ERROR:  While executing gem ... (Gem::RemoteSourceException)
HTTP Response 302 fetching http://gems.rubyforge.org/yaml

You can install rubygems version 1.3.7 with:

% curl -LO http://production.cf.rubygems.org/rubygems/rubygems-update-1.3.7.gem 
% gem i rubygems-update-1.3.7.gem 
% update_rubygems

CONFIG

Edit config file $home_cleaner-DIR/config/home_cleaner.yml for your needs of threshold and account which should not be deleted. Default config:

  • For deletion blacklisted directories: /Users/{admin,lokal,Shared}

  • threshold: > 1 month old

A launchd $home_cleaner-DIR/launchd/de.fuberlin.home_cleaner.plist is provided for running each monday at 7:01 AM. Just copy it to /Library/LaunchDaemons/ and change it for your needs.

$home_cleaner-DIR = grandparent directory of:

% gem which home_cleaner

Bug reports

Please, send me an e-mail.

DEVELOPMENT

To check out the source code:

% git clone http://github.com/szuecs/home_cleaner.git

AUTHORS

Sandor Szücs, sandor.szuecs@fu-berlin.de

LICENSE

See LICENSE file.