To get rid of if run: launchctl unload ~/Library/LaunchAgents/de. It should still be there after a reboot and hybernation. You may also verify that the Python Process is running by: ps -ef |grep Pythonġ001 51972 51946 0 9:12PM ? 0:04.30 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/amework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python -m attr_sync_thing -d -r /Users/you/Nextcloud/ startġ001 51978 45668 0 9:12PM ttys001 0:00.00 grep Python Verify that the launch agent is loaded: launchctl list | grep attr-sync-thing This will do the trick: launchctl load ~/Library/LaunchAgents/de. Capturing stdout doesn’t seem to work, though. My comments on logging might be usefull to those, who want to develop the script further. Logging could be more informative, but I got it to work this way, so my motivation is limited.Ĭreate a file named something like ~/Library/LaunchAgents/de. with the following contents: Label de.tux4web.attr-sync-thing Program /Users/you/Library/Python/3.8/bin/attr_sync_thing ProgramArguments /Users/you/Library/Python/3.8/bin/attr_sync_thing -r /Users/you/Nextcloud -debug -l /Users/you/Library/Logs/attr_sync_thing.log start KeepAlive StandardErrorPath /Users/you/Library/Logs/attr_sync_ StartInterval 20 WorkingDirectory /Users/you ĭont forget to change “you” to your login! The -d, “debug”, command line parameter will make it report the watchdog events is processing. ~/Library/Python/3.8/bin/attr_sync_thing -r ~/Nextcloud -d start This will copy the metadata from the pickle files to the watched files. On my system syncing 28,000 files took some patience and several friendly restarts of the nextCloud app to achieve this.Īnyway, here we issue: ~/Library/Python/3.8/bin/attr_sync_thing -r ~/Nextcloud refresh-files On the other Macs we assume that the nextCloud or ownCloud desktop client has done its work and downloaded all those. *Cloud does not copy the hidden flag for us. This step you’ll need to perform on all Macs you want it to be hidden on. You may (optionally) hide this file from the Finder by issuing: chflags hidden ~/Nextcloud/Attribute_Storage.noindex/ This will create ~/Nextcloud/Attribute_Storage.noindex with a bunch of. We are ready to create our initial set of pickle files: ~/Library/Python/3.8/bin/attr_sync_thing -r ~/Nextcloud refresh-pickles Usage: attr_sync_thing ]] Īttr_sync_thing: error: the following arguments are required: command (1) We start by installing the Python module and its dependencies: /usr/bin/pip3 install attr-sync-thingįollowing this command, there should be a script available at ~/Library/Python/3.8/bin/attr_sync_thing callable like this: ~/Library/Python/3.8/bin/attr_sync_thing If you run your own version of Python, you know what a virtualenv ist and how to use it – cool! We will be using the Python 3.8 installation that shipes with the OS (or with Xcode? I honestly don’t know) and install to ~/Library/Python. This installation guide assumes MacOS 12.5 (because that’s what I got here). Neither will knowing a little bit about launchd. I am afraid some system administration skills (changing plain-text files, running commands in the terminal) are required. I checked the source code of the (otherwise excellent) MacOS desktop clients, but my C++ skills aren’t good enough to implement it. It is designed to be run as a normal user’s service through launchd.Įxtended attribute (Finder Metadata) sync is missing from ownCloud and nextCloud. The script will watch for changes in the file tree and sync pickles to metadata and metadata to pickles on each of your computers. These files get synced by the cloud system’s desktop client. This script will create a pickle file for each file in your synced filter tree. Sync MacOS extended attributes through tools that do not support them (like nextCloud or ownCloud).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |