Giter VIP home page Giter VIP logo

macprefs's People

Contributors

antonprokopyev avatar clintmod avatar marcomc avatar piyush1104 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

macprefs's Issues

Rsync error

Error detail-

Error Info:
error code = 23
cmd ['rsync', '-a', '/Library/LaunchDaemons/', '/Users/sanimkhan/Dropbox/MacPrefsBackup/StartupItems/LaunchDaemons/AllUsers/']
error message:rsync: send_files failed to open "/Library/LaunchDaemons/com.microsoft.teams.TeamsUpdaterDaemon.plist": Permission denied (13)
rsync error: some files could not be transferred (code 23) at /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54.120.1/rsync/main.c(996) [sender=2.6.9]

Traceback-

  File "/usr/local/bin/macprefs", line 73, in <module>
    main()
  File "/usr/local/bin/macprefs", line 69, in main
    invoke_func(args)
  File "/usr/local/bin/macprefs", line 39, in invoke_func
    args.func()
  File "/usr/local/bin/macprefs", line 17, in backup
    startup_items.backup()
  File "/usr/local/Cellar/macprefs/1.0.26/bin/startup_items.py", line 10, in backup
    backup_system_daemons_agents()
  File "/usr/local/Cellar/macprefs/1.0.26/bin/startup_items.py", line 35, in backup_system_daemons_agents
    copy_dir(source, dest)
  File "/usr/local/Cellar/macprefs/1.0.26/bin/utils.py", line 31, in copy_dir
    execute_shell(command)
  File "/usr/local/Cellar/macprefs/1.0.26/bin/utils.py", line 12, in execute_shell
    cwd=cwd, stderr=STDOUT).strip().decode("utf-8")
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['rsync', '-a', '/Library/LaunchDaemons/', '/Users/sanimkhan/Dropbox/MacPrefsBackup/StartupItems/LaunchDaemons/AllUsers/']' returned non-zero exit status 23

System detail-
macOS Catalina
version 10.15.7

backup/restore exit code 23

Hi Clint (and others),

Upon running backup it returned error code 23. Files were created though. So I just tried the restore. The same holds for the restore. Output logs are attached. I run the v1.0.26 script in Mojave.
Can someone help?
macprefs-backup.log
macprefs-restore.log

Thanks in advance!

Agape

Homebrew version is outdated

brew is installing version 1.0.26 which correspond to the latest tag but do not correspond to the latest master.
1.0.26 is not compatible with Python3, the latest master is.

it would require a version tagging for the current master and updating brew.

thanks

cannot create backup

Hello,

I've just installed macprefs but I'm unable to create a backup because the folder

/Library/Application Support/com.apple.sharedfilelist

doesn't exist on my machine.

I just (re)installed from an existing TimeMachine backup a few days ago and I'm running macOS Sierra (10.12.6).

Attached I'm sending you the output when running "macprefs backup".

log.txt

Clean uninstall?

Macprefs creates quite a few symlinks in /usr/local/bin - and maybe in other places? brew uninstall macprefs doesn't remove these symlinks. Is there a clean way of ensuring a complete uninstall of macprefs?

SyntaxError: Missing parentheses in call to 'print' when running on Python3

The requirements say Python 3.6.0 is required
but in reality, it looks like the code has been written with Python2 standards
in fact if I run the application with Python 3.x it fails as follow:

python /usr/local/bin/macprefs restore
  File "/usr/local/bin/macprefs", line 23
    print 'Backup Complete.'
                           ^
SyntaxError: Missing parentheses in call to 'print'

if I run it in Python 2 it works fine

are you planning to adapt the code?

Error with Restore

stephane@mac:~$ sudo macprefs restore

Restoring system preferences...
Restoring: /Library/Preferences/SystemConfiguration/com.apple.PowerManagement from /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist
Error Info:
error code = 1
cmd ['defaults', 'import', '/Library/Preferences/SystemConfiguration/com.apple.PowerManagement', '/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist']
error message: 2017-11-22 06:06:56.029 defaults[57120:244331] Could not read data from /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist

Traceback (most recent call last):
File "/usr/local/bin/macprefs", line 55, in
main()
File "/usr/local/bin/macprefs", line 51, in main
invoke_func(args)
File "/usr/local/bin/macprefs", line 32, in invoke_func
args.func()
File "/usr/local/bin/macprefs", line 23, in restore
system_preferences.restore()
File "/usr/local/Cellar/macprefs/1.0.15/bin/system_preferences.py", line 46, in restore
power_management_restore_path])
File "/usr/local/Cellar/macprefs/1.0.15/bin/utils.py", line 14, in execute_shell
cwd=cwd, stderr=STDOUT).strip()
File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 219, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['defaults', 'import', '/Library/Preferences/SystemConfiguration/com.apple.PowerManagement', '/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist']' returned non-zero exit status 1

SyntaxError: Missing parentheses in call to 'print'

Hello,

I installed the package via homebrew. I am running python 3.11. I preformed the command "macprefs backup" and was presented with the following message...
Screen Shot 2023-11-27 at 10 12 32 PM

Doing some digging online I found this source, which describes that in python 3 parentheses are to be added to the print call out.

I went into the script and added parentheses to these call-out's.

  • Backup Complete
  • Restore Complete

After making those changes, I got the following result after trying the command "macprefs backup".
Screen Shot 2023-11-27 at 10 12 12 PM

Permission problems with system LaunchAgent/Daemons

I was migrating from a somewhat more relaxed laptop setup to a new one that has a few security tools on it and I had problems when macprefs was trying to chown on /Library/LaunchAgents

https://github.com/clintmod/macprefs/blob/master/startup_items.py#L45-L56

I'm able to chown the directory by hand when I omit -R and on most .plist items but anything owned by the security tools in question prevented me from doing a chown, even if it was to the same user/group it already had (root:wheel) that macprefs is trying to apply.

Makes me wonder if it is best to only chown the files that macprefs copied over? Or fail but warn, not totally bail out of macprefs, this would, however, need a file list to chown on instead of a full dir.

new release for version 1.0.26

Hi!
would you please make a new release for version 1.0.26 which fixes the issues with python3?
that would probably allow the maintainer of the homebrew package to install the latest version?

unrecognized arguments: -t system_preferences

when running macprefs like the documentation

macprefs backup -t system_preferences startup_items preferences app_store_preferences internet_accounts
an error is thrown

$ macprefs --version
v1.0.26

$ macprefs backup -t system_preferences
usage: macprefs [-h] [--version] [--verbose]  ...
macprefs: error: unrecognized arguments: -t system_preferences

Hardcoded path `~/Dropbox` for some directories

I don't have Dropbox and never did.
My backup directory is configured at startup:
export MACPREFS_BACKUP_DIR=/Users/username/.macprefs
However, some directories are being created in ~/Dropbox (the directory Dropbox is being created):

app_store_preferences
dotfiles
preferences
shared_file_lists
ssh
StartupItems
system_preferences

I manually moved them into the directory I configured, but now I'm concerned, if the restore function also has hardcoded paths.

Backup ~/Library/Containers for App Store apps

I'd like to backup the ~/Library/Containers for app store application preferences but it also contains a bunch of other files and symlinks to directories. Symlinks don't play well with dropbox as it likes to follow them and back up a bunch of unintended stuff. This was requested by @michael-bakker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.