I have a policy setup that is scoped to a smart computer group consisting of only MacBooks. The policy is setup to create a shortcut to a script located in the top level of the directory. The policy runs a script
#!/bin/sh
cd /Users/$3/Desktop
if [ ! -L "Backup.sh" ]
then
ln -s /Backup.sh
else
exit 0
fi
to create an Alias to /Backup.sh on the users desktop. The script works with out issue on most computer but every once in a while I will get a failed policy showing:
Executing Policy Backup Shortcut Running script Create Backup Shortcut... Script exit code: 1 Script result: ln: ./Backup.sh: File exists Error running script: return code was 1.
Does anyone have any idea why this would be happening? If I run the script locally there are no issues and usually if I force the policy to run again on the erred machine it runs without issue.
Any help is appreciated
Attached is the trigger settings for the policy as well