LaunchAgents: plist .command ausführen

strukturart

Erfahrenes Mitglied
Hallo,

ich möchte einmal täglich ein Datei (.command) automatisch ausführen die eine Terminal Befehl ausführt,
die der Inhalt der Datei sieht so aus:

hello.command
Code:
#!/bin/bash
cd desktop
wget -r -l0 --ftp-user=xxxx--ftp-password=xxxx --directory-prefix=/Users/xxxx/Desktop --no-parent ftp://www.xxxx.com/html/xxxxx/

wenn ich sie manuel mit einem Doppelklick auf die Datei starte werden die Befehle via Terminal korrekt ausgeführt.

Jedoch wenn ich sie mit dem LaunchAgent ausführe erhalte ich die Errormeldung:

Code:
/Users/xxxxxx/Desktop/hello.command: line 2: cd: desktop: No such file or directory
/Users/xxxxxx/xxxx/hello.command: line 3: wget: command not found

Meine .plist Datei sieht so aus:

Code:
<?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>
    <!-- The label should be the same as the filename without the extension -->
    <string>org.yourusername.email-mom</string>
    <!-- Specify how to run your program here -->
    <key>ProgramArguments</key>
    <array>
   
        <string>/Users/xxxxxxx/Desktop/hello.command</string>
    </array>
 
    <key>Nice</key>
    <integer>1</integer>
    <!-- Run every minute -->
    <key>StartInterval</key>
    <integer>60</integer><!-- seconds -->
 
    <key>RunAtLoad</key>
        <true/>
     
     
        <key>StandardErrorPath</key>
         <string>/Users/xxxxxx/Desktop/AlTest1.err</string>

         <key>StandardOutPath</key>
         <string>/Users/xxxxxx/Desktop/AlTest1.out</string>
</dict>
</plist>


Was mache ich falsch?
 
Zurück