—
I am running OSX 15.7.9. I am trying to use launchd to run rsync at 0100 every day. I understand it says launched.savesafarisession.plist instead of launchd.savesafarisession.plist but should still work.
safari_backup.sh
#!/bin/bash
# Force the script to write any inner terminal errors to a debug file
exec 2>>/tmp/script_internal.err
/usr/bin/rsync -a /Users/XXX/Library/Containers/com.apple.Safari/Data/Library/Safari/ /Users/XXX/Safari
Ran chmod on .sh file
chmod +x /Users/XXX/Documents/safari_backup.sh
launched.savesafarisession.plist
<?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">
<!-- generated by launched https://launched.zerowidth.com/plists/0GYhL6RMZ -->
<plist version="1.0">
<dict>
<key>Label</key>
<string>launched.savesafarisession</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>/Users/XXX/scripts/safari_backup.sh</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>1</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/tmp/safari_backup.out</string>
<key>StandardErrorPath</key>
<string>/tmp/safari_backup.err</string>
</dict>
</plist>
I have added full disk access to the safari_backup.sh file and for extra measure, I added rsync
There are no errors in the log files, those files are empty
I can run rsync through the terminal with no problem and the files are copied to:
/Users/XXX/Safari
I loaded it with launchctl and tried to run with no luck
It seems to run but nothing is copied or shows up in the error logs


