I'm trying to log the output of the command:
innobackupex --incremental $INC1_BACKUP_FOLDER --incremental-basedir=$BASEDIR_FULL $SLAVE_INFO > $PATH_TO_LOG/log_inc1.txt 2>&1
;
however it does not write to file rather prints on STDOUT.
This works and logs to file:
innobackupex $DB_USER_INFO $FULL_BACKUP_FOLDER $SLAVE_INFO > $PATH_TO_LOG/log_full.txt 2>&1
;
however this does not log to file:
innobackupex --incremental $INC1_BACKUP_FOLDER --incremental-basedir=$BASEDIR_FULL $SLAVE_INFO > $PATH_TO_LOG/log_inc1.txt 2>&1
;
the other solution I tried is:
open (INC1_RESULT,">$PATH_TO_LOG/log_inc1.txt");
my $incr1_backup_result = `innobackupex --incremental $INC1_BACKUP_FOLDER --incremental-basedir=$BASEDIR_FULL $SLAVE_INFO`;
print INC1_RESULT $incr1_backup_result;
close INC1_RESULT;
which did not work either because it will only write to the file after the command completes execution. I need to tail the log when the command is running.