#!/bin/bash
…
function logger(){
LOG_FILE="$1"
while read LOG_STRING ; do
echo "$LOG_STRING"
echo "$LOG_STRING" >> "$LOG_FILE"
done;
}
{
#backuping
echo "Starting backup [$CUR_DATE]"
mkdir "$CUR_DEST"
echo "Backup Trac:"
…
echo "Backup PSQL:"
…
echo "Backup Svn:"
…
echo "Mirroring backup to:$REMOUTE_DIR"
…
echo "The End…"
} 2>&1 | logger "$CUR_DEST.log"
cp "$CUR_DEST.log" "$REMOUTE_DIR"
Вот пока так делаю, есть ли менее извращенные способы?