Scripts to backup and restore settings modified by .osx #58

wants to merge 9 commits into from

2 participants


I noticed quite a few people were worried about permanently losing the OS defaults, so I created a couple of scripts to backup and then restore the settings.

The backup script needs to be run before .osx. This could potentially be called from .osx automatically.

The settings are backed up to a text file .osx_settings_backup in the format <setting> : <value>. This file I've added to the ignores.

The restore script uses the backup file to restore all the settings.

I've been using both scripts with success on a couple of machines. Not a problem if you think it's overkill, but it might come in handy for a few people. Let me know what you think.


If new settings are added to .osx, it won't be possible to run the script again without deleting the backup and then it would be restoring already modified settings. It needs to compare the settings which were already backed up, with the ones present in .osx. Even then, there is a change that you are backing up previously modified values.

Although the backup script has a lot of value, another useful solution would be to have a .osx.reset which is similar to .osx , but configured with the OS X default values. For each new setting added to .osx, a equivalent setting with the defautl value would have to be added to .osx.reset.

@aristidesfl aristidesfl referenced this pull request May 7, 2012

More .osx suggestions? #5


Okay, so I get what you're saying but I think there is already a way around the problem.

To clarify, the problem is essentially this: "New settings being added to .osx, woud not be present in the backup."

To get around this:

  1. Run the restore script, so that all settings have been returned to their default values. (Now safe to move/delete backup)
  2. Run the backup script, which automatically inspects the .osx script for the settings being modified and results in an up to date backup of default values.
  3. Finally, you run the .osx to modify the system settings.

You could even incorporate this into a single script.

BTW, excuse the large number of commits in the pull request.

MozMorris added some commits Apr 26, 2012
@MozMorris MozMorris Handle many of the backup settings automatically using some grep and …
…sed power
@MozMorris MozMorris Merge branch 'master' of
* 'master' of
  Friendly output messages and regex on '-array-add' as a setting type
  Handle many of the backup settings automatically using some grep and sed power
@MozMorris MozMorris closed this Nov 24, 2012
This was referenced Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment