How to delete directory content with launchd
Shell globbing (<string>/tmp/test/👉*👈</string>
) is not supported by launchd!
You can either remove the whole folder test <string>/tmp/test</string>
or launch a shell script rmtestcontent (in the example /usr/local/bin/rmtestcontent) with the content:
#!/bin/bash
/bin/rm -fr /tmp/test/*
with the 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">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.my.script.removetemp</string>
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>/usr/local/bin/rmtestcontent</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>45</integer>
<key>Hour</key>
<integer>23</integer>
</dict>
</dict>
</plist>
to empty the directory /tmp/test.