Mac OS 10.11
CrashPlan 4.3.4
JSS 9.82
CrashPlan - Last Backup Extension Attribute from template
!/bin/sh
CP_ServerAddress="crashplan.myserver.com"
CP_ServerPort="4285"
CP_AdminUsername="myadminusername"
CP_AdminPassword="myadminpassword"
if [ "$CP_ServerAddress" == "" ] || [ "$CP_ServerPort" == "" ] || [ "$CP_AdminUsername" == "" ] || [ "$CP_AdminPassword" == "" ];then
echo "Please ensure all variables are set in the extension attribute script."
else
if [ -f /Library/Application Support/CrashPlan/.identity ];then
GUID=/bin/cat /Library/Application Support/CrashPlan/.identity | grep guid | sed s/guid=//g
value=/usr/bin/curl -u "$CP_AdminUsername":"$CP_AdminPassword" -k https://"$CP_ServerAddress":"$CP_ServerPort"/rest/computerUsage?sourceGuid="$GUID" | grep -w lastActivity | awk '{print $2}' | sed s/,//g | sed 's/.(.*)/1/'
result=/bin/date -j -f "%Y-%m-%dT%H:%M:%S" "$value" "+%Y-%m-%d %H:%M:%S"
echo "<result>$result</result>"
else
echo "<result>Not installed</result>"
fi
fi
I have tried a couple of them and they return this error:
Failed conversion of '' using format%Y-%m-%dT%H:%M:%S''
date: illegal time format
I see similar posts dating back several versions over several years, with several fixes suggested. None seem to work with the 9.82 JSS and CrashPlan PROe 4.3.4.
Has anyone got this working with newer versions of these solutions?