Last active
          December 10, 2015 17:18 
        
      - 
      
- 
        Save nigelr/4466477 to your computer and use it in GitHub Desktop. 
    Resizes TimeMachine sparesbundle maximum size and then locks the file
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/bin/bash | |
| # This script resizes a sparsebundle and locks the Info.plist to prevent timemachine resizing it. | |
| # Usage | |
| # resize.sh MacBook.sparsebundle 100g | |
| # which resizes the sparse bundle to 100GB | |
| echo "unlocking Info.plist" | |
| SetFile -a l "${1%/}/Info.plist" | |
| echo "Resizing '$1' to '$2'" | |
| hdiutil resize -size $2 -shrinkonly "$1" | |
| echo "locking Info.plist" | |
| SetFile -a L "${1%/}/Info.plist" | |
| echo "Complete" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment