I use operator ">>" in shell script, assuming to append the log file.But there is something wrong
===

This is the function I use to write logs.

    log() {
            DATE=`date`
            echo "[$DATE] $1" >> "$SCRIPT_DIR/auto.log" }

This script runs 1 time per minute, and Every time it truncated the log file and then append the file.I use tail to see what happens, and it appears:

tail: auto.log: file truncated

The function is the only place I use the auto.log in the script, why it truncated when the script start every time ?