Community Information
-
•
Launchd routine doesn’t work
I’m trying to setup a bash script to run every 10 minutes to backup my Obisidan vault to a git repository. It's a simple script that looks like this: ``` #!/bin/bash export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" VAULT="/Users/<my-username>/Documents/<vault-folder>" git -C "$VAULT" add . git -C "$VAULT" commit -m "backup at $(date)" git -C "$VAULT" pull --rebase -Xours -Xignore-all-space git -C "$VAULT" push ``` It has the required permissions. I can run it manually. My .plist file to set up automation with launchd looks like this: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>obsidian-backup</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/Users/<my-username>/Dev/scripts/obsidian-backup.sh</string> </array> <key>StartInterval</key> <integer>600</integer> <key>RunAtLoad</key> <true/> </dict> </plist> ``` When I load it using `launchctl load ~/Library/LaunchAgents/obsidian-backup.plist` it returns error 128. --- I tried to simplify things by using this same setup, but with a script that just prints `Hello World` to the terminal. Again, it runs manually, but when I set it up like before, it doesn't print anything to the terminal, but this time it actually shows that it was a success. Can you help me fix it? TIA5
© 2025 Indiareply.com. All rights reserved.