1

I have a launch daemon that I just can't get to work. It's supposed to run a script every day at 3 AM. The script works and I can run it manually without sudo. See below for the launch daemon (com.rsync.plist) and the output of the commands I ran to start it. If anyone has any ideas why it won't run, I would really appreciate it.

'''

<?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>com.rsync</string>
                <key>Program</key>
                <string>/Users/xserve10/Documents/rsync.sh</string>
                <key>StartCalendarInterval</key>
                <dict>
                        <key>Hour</key>
                        <integer>3</integer>
                        <key>Minute</key>
                        <integer>0</integer>
                </dict>
        </dict>
</plist>


Xserve-10s-Mac-mini:Documents xserve10$ ls /Library/LaunchDaemons/com.rsync.plist
/Library/LaunchDaemons/com.rsync.plist
Xserve-10s-Mac-mini:Documents xserve10$ sudo launchctl load -w /Library/LaunchDaemons/com.rsync.plist
Password:
/Library/LaunchDaemons/com.rsync.plist: service already loaded
Load failed: 37: Operation already in progress

'''

5
  • The file seems to be already loaded, try unloading it first with sudo launchctl unload /Library/LaunchDaemons/com.rsync.plist. Commented Oct 20, 2022 at 13:49
  • I've tried that several times. I've also tried setting it in my local LaunchAgents folder, still not working. Commented Oct 20, 2022 at 14:17
  • I'd recommend that you move /Library/LaunchDaemons/com.rsync.plist elsewhere, restart your Mac, copy rsync.plist back to /Library/LaunchDaemons/ and run sudo launchctl load again. You may want to name com.rsync.plist differently, for example local.rsync.plist, to make it clear that you aren't running an "official" rsync plist, but a modified one. Commented Oct 20, 2022 at 14:43
  • You may be running into privacy protection on the user's Documents folder; see "What and how does macOS Mojave implement to restrict applications access to personal data?" and "How to run a LaunchAgent that runs a script which causes failures because of System Integrity Protection". Try moving it (and any other files it accesses) outside the user's home folder. Commented Oct 20, 2022 at 15:55
  • Thanks, I tried moving it to /Library/Scripts, I'll see if it works tomorrow. Commented Oct 20, 2022 at 19:29

1 Answer 1

0
  • sudo launchctl unload /Library/LaunchDaemons/com.rsync.plist
  • sudo launchctl load -w /Library/LaunchDaemons/com.rsync.plist
Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.