clintmod / macprefs Goto Github PK
View Code? Open in Web Editor NEWBackup and Restore your Mac System and App Preferences (e.g. defaults write)
License: MIT License
Backup and Restore your Mac System and App Preferences (e.g. defaults write)
License: MIT License
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
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
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
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".
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?
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?
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
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...
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.
After making those changes, I got the following result after trying the command "macprefs backup".
~ ❯❯❯ macprefs backup
env: python: No such file or directory
macOS: 13.1 (22C65)
Processor: Intel Core i9
install command: brew install clintmod/formulas/macprefs
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.
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?
when running macprefs like the documentation
Line 53 in af23467
$ macprefs --version
v1.0.26
$ macprefs backup -t system_preferences
usage: macprefs [-h] [--version] [--verbose] ...
macprefs: error: unrecognized arguments: -t system_preferences
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.