rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

Won't work with Launchd

Open debaron opened this issue 4 years ago • 1 comments

Can someone please tell me so I stop tearing my hair out:

  • How can I get this to work with Launchd?? I will not at present

  • If it doesn't work please can it be made obvious in the readme

I DON'T want to use crontab.

debaron avatar Apr 07 '20 18:04 debaron

Ok, I just got it working with launchd. I'm not able to write a detailed guide right now, but I hope you can google each step for details.

  1. Create a shell script that runs the rsync-time-backup, make sure it works when you run it manually from the terminal
  2. Open Automator and create an "app" that simply runs that script and does nothing else
  3. Under system preferences, grant this app "full disk access" permission
  4. Create plist for the launchd that runs that app. Below is an example that runs the app every 10 seconds
  5. Put that plist in ~/Library/LaunchAgents/.plist and load with command launchctl load ...
  6. Done!
<?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.backup</string>
    <key>ProgramArguments</key>
    <array>
      <string>open</string>
      <string>-a</string>
      <string>/Users/<you>/Scripts/rsync/rsync_run.app</string>
    </array>
    <key>StartInterval</key> 
    <integer>10</integer>
</dict>
</plist>

nalexn avatar May 16 '20 16:05 nalexn