I have a simple backup script setup as shown below. I would like to modify so that it only runs when on AC power. Is this something I can achieve with launchd settings, or perhaps I could have the backup binary check if I am on AC power and reschedule for a later run?

<?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">

        <!-- Run this thing -->

        <!-- Only run when there is a GUI -->

        <!-- Once every 24 hours -->

        <!-- Enable debugging -->

        <!-- Play nice -->

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.