rsync errors, but only when run in launchd

Solution 1:

Your running in different contexts when you use launchd and iterm2. With iterm2 your profile gets run but your profile isn't run when you use launchd.

Some programmers invoke there profile from their launchd script. I do everything so it works without the need to run my profile.

I suggest you cd to whatever directory you ended up in iterm2.

I wrote a little function to display all my terminal settings. Run this in iterm2 and launchd while sending output to a file and compare.

settings () 
{ 
    ( echo "---------- env ----------";
    env;
    echo "--------- set ----------";
    set;
    echo "--------- export ----------";
    export;
    echo "--------- export -f ----------";
    export -f;
    echo "--------- alias ----------";
    alias;
    echo "--------- set -o ----------";
    set -o;
    echo "--------- shopt ----------";
    shopt;
    echo "--------- enable -a ----------";
    enable -a ) | less
}

for terminal you can copy & paste settings to terminal.

settings >>/Users/mac/xset
cat xset