LaunchAgents zip/tar not working in plist? I created the plist for a  'custom' backup agent (via LaunchAgent). The (zip) program is called, but I keep getting a 'zip error: Nothing to do!' in my logs.
I assume it has something todo with permissions. I did add sh and zip to my Full Disk Access security settings. But it did not help.
On a side-note, when I move the zip command in a shell (sh) script, it works.
I would like to know why using the zip command directly doesn't?
Running the command for the terminal works also without issues, like so:
/usr/bin/zip /Users/username/Backup/test.zip /Users/username/Documents/*.pdf

LaunchAgent script:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.myuser.DailyBackup&lt;/string&gt;
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;/usr/bin/zip&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;/Users/username/Backup/test.zip&lt;/string&gt;
        &lt;string&gt;/Users/username/Documents/*.pdf&lt;/string&gt; 
    &lt;/array&gt;    
    &lt;key&gt;StandardOutPath&lt;/key&gt;
    &lt;string&gt;/tmp/my.backup.log&lt;/string&gt;    
    &lt;key&gt;StandardErrorPath&lt;/key&gt;
    &lt;string&gt;/tmp/my.backup.err&lt;/string&gt;    
    &lt;key&gt;Debug&lt;/key&gt;
    &lt;true/&gt;    
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;10&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;
From man launchd.plist
ProgramArguments &lt;array of strings&gt;
This key maps to the second argument of execvp(3) and specifies the argument vector to be passed
to the job when a process is spawned. This key is required in the absence of the Program key.
IMPORTANT: Many people are confused by this key. Please read execvp(3) very carefully!

So you need to use
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;/usr/bin/zip&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;zip&lt;/string&gt;
        &lt;string&gt;/Users/username/Backup/test.zip&lt;/string&gt;
        &lt;string&gt;/Users/username/Documents/*.pdf&lt;/string&gt; 
    &lt;/array&gt;    

It still won't work though because launchd doesn't expand wildcards and zip doesn't either. It's easier to use launchd to start a shell script which does all the work then.