Saturday, August 9, 2025

bash – Shell script run daily by launchd stopped working after macOS Sequoia upgrade

I have a setup to copy backups from an Ubuntu 22 server running in the cloud to a local Mac.
On the Mac I have a shell script to run the rsync command and a launchd daemon to run this script daily.

This has been working as expected until macOS was upgraded to Sequoia, after which it stopped working.

The shell script works as expected when run manually with sudo in Terminal, but fails without sudo. I suspect this is a hint, although I can’t figure out why it worked prior to Sequoia, or what I should change to get it to work now. (The ‘back’ user is for a real human to access the backups in Finder)

The script:

#!/bin/bash -p

#Use special key for rsync
export RSYNC_RSH="ssh -i /Users/back/.ssh/.ssh-noautoload/unattended-rsync"

#Transfer
rsync -avH [email protected]:'"/opt/FileMaker/FileMaker Server/Data/Backups/Day*"' /Users/back/Documents/backups/

#Goodbye
exit 0

The launch daemon:

<?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>hentfmsbackup</string>
                <key>Program</key>
        <string>/Users/back/.rsyncScripts/getBackup.sh</string>
                <key>RunAtLoad</key>
                <false/>
        <key>StartCalendarInterval</key>
        <dict>
            <key>Hour</key>
            <integer>0</integer>
            <key>Minute</key>
            <integer>15</integer>
        </dict>
        <key>KeepAlive</key>
        <dict>
            <key>SuccessfulExit</key>
            <false/>
        </dict>
        <key>UserName</key>
        <string>back</string>
        </dict>
</plist>

Searching for answers have not turned up any solution yet. All tips/hints are welcome.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles