AFP548

LaunchD ProgramArguments

Am I doing this right?

If I have a script that takes an argument of a directory path and does actions on that directory, can I use ProgramArguments to specify multiple directory paths? Will the following launch my script multiple times simultaneously? or in order of ProgramArguments?

<key>Label</key>
        <string>reset-user-permissions</string>
        <key>Program</key>
        <array>
                <string>/usr/local/bin/reset-user-permissions.pl</string>
        <key>ProgramArguments</key>
        </array>
        <array>
                <string>/usr/local/bin/reset-user-permissions.pl /Volumes/Users/a</string>
                <string>/usr/local/bin/reset-user-permissions.pl /Volumes/Users/b</string>
                <string>/usr/local/bin/reset-user-permissions.pl /Volumes/Users/c</string>
        </array>
        <key>StandardOutPath</key>
        <string>/usr/local/mystuff/logs/scripts.log</string>
        <key>StandardErrorPath</key>
        <string>/usr/local/mystuff/logs/scripts.error.log</string>
        <key>UserName</key>
        <string>root</string>
        <key>StartCalendarInterval</key>
           <dict>
               <key>Minute</key>
               <integer>30</integer>
               <key>Hour</key>
               <integer>3</integer>
           </dict>
</dict>
</plist>


Exit mobile version