1)/usr/local/src/datecrontalog.sh
#!/bin/bash
if [ $# -gt 1 ]; then
istring=''
#去掉回车
date=`date | tr -s ["
"]`
for (( i = 2; i <= $#; i++ ))
do
string=$string" "${!i}
done
c=$date": "$string
echo "" >> $1
echo $c >> $1
fi
2)
*/1 * * * * /opt/otrs/bin/otrs.Console.pl Maint::Cache::Delete --type Group 2>&1 | xargs /usr/local/src/datecrontalog.sh /tmp/otrs_de