Skip to content

maxhewett/PruneUsers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PruneUsers

This script is intended for use with shared-Mac environments, and helps to remove old users and home directories to free up space and de-clog the login window.

Functionality:

There are 2 key ways this script functions:

  1. Secure Delete (--secure): Use caution with this method. Secure delete will look for accounts not used in your specified day range, then delete their user record and home folder. The use of an LA is not required

    Example Usage: For a secure delete based on accounts not used in 14 days: ./PruneUsers.sh --secure 14

  2. Soft Delete (--soft): When using the soft delete option, it should be used alongside the accompanying LaunchAgent (com.maxhewett.UserPruner.plist) which will delete the home folders that are identified by this script. This deletion will occur 30 days after the user is soft deleted.

    Example Usage: For a dry run soft delete based on accounts not used in 45 days: ./PruneUsers.sh --soft --dry-run 45

Usage

PruneUsers.sh [options] [days_inactive]

Soft Delete (default):

When using this script with the soft delete option, it should be used alongside the accompanying 
LaunchAgent (com.maxhewett.UserPruner.plist) which will delete the home folders that are identified 
by this script. This deletion will occur 30 days after the user is soft deleted.

Example Usage:
For a dry run soft delete based on accounts not used in 45 days: 
./PruneUsers.sh --soft --dry-run 45

-----------------------------------

Secure Delete:

Use caution with this method. Secure delete will look for accounts not used in your specified day range, 
then delete their user record and home folder. The use of an LA is not required

Example Usage:
For a secure delete based on accounts not used in 14 days:
./PruneUsers.sh --secure 14

-----------------------------------

options:
-h --help              show this help text
-v --verbose           verbose output
-n --dry-run           dry run simulation
--secure               perform secure deletion
--soft                 perform soft deletion
--debug                show all debug output

-----------------------------------

Changing Default Options:

Modify the accompanying LaunchAgent ProgramArguments. Default is soft delete, 30 days.`

About

Helps to remove old users and home directories to free up space and de-clog the login window.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages