I'm using in my script:
tar cfh - "$SRC_DIR" --exclude-from <(find $SRC_DIR -size +$EXCLUDE_MB_FILES) | pigz -9 --quiet --keep --recursive --rsyncable > $BACKUP_TARGER_DIR/$ARC_NAME | tee $LOG_FILE
But LOG_FILE
is empty. Why?
I'm using in my script:
tar cfh - "$SRC_DIR" --exclude-from <(find $SRC_DIR -size +$EXCLUDE_MB_FILES) | pigz -9 --quiet --keep --recursive --rsyncable > $BACKUP_TARGER_DIR/$ARC_NAME | tee $LOG_FILE
But LOG_FILE
is empty. Why?
Split command:
find -L $SRC_DIR -size +$EXCLUDE_MB_FILES > $EXCLUDE_LIST 2>> $LOG_FILE
RC=$?;
if [[ $RC != 0 ]]; then
error find $RC
fi
tar cfh $TAR_FILE "$SRC_DIR" --exclude-from $EXCLUDE_LIST &>> $LOG_FILE
RC=$?;
if [[ $RC != 0 ]]; then
error tar $RC
fi
pigz -9 --quiet --keep --recursive --rsyncable $TAR_FILE &>> $LOG_FILE
RC=$?;
if [[ $RC != 0 ]] || [ ! -f $GZ_FILE ]; then
error pigz $RC
fi
mv $GZ_FILE $BACKUP_TARGER_DIR/$ARC_NAME
RC=$?;
if [[ $RC != 0 ]]; then
error mv $RC
fi
(tar cfh - "$SRC_DIR" --exclude-from <(find $SRC_DIR -size +$EXCLUDE_MB_FILES) | pigz -9 --quiet --keep --recursive --rsyncable > $BACKUP_TARGER_DIR/$ARC_NAME) 2>"$LOG_FILE"
without splitting up
– muru
Sep 01 '17 at 12:47
pigz
's output to$BACKUP_TARGER_DIR/$ARC_NAME
, so nothing goes to the pipe totee
.$LOG_FILE
is naturally empty. – muru Sep 01 '17 at 00:59