How to log streaming backup

I am changing my backups to streaming and tar’ing them up.

xtrabackup --backup --stream=tar --target-dir=$dest > “$dest2/backup.tar”

How do I log the messages to a file. I’ve tried adding > log.txt but that did not work.

Hi @pythondev1
Try this,
xtrabackup --backup --stream=tar --target-dir=$dest > “$dest2/backup.tar” >> log.txt 2>&1

Hope this helps.

Thanks I tried something similar and it worked.

Happy to know @pythondev1 you found the solution. May be you can share in your comment. It will be helpful for other
users. :) 

Sure here is my script. 

xtrabackup --defaults-file=/etc/alternatives/my.cnf --defaults-group=mysqld2 --socket=/var/run/mysqld/db2.sock --user=root --password=$pwd_value --backup --stream=tar --target-dir=$dest 2> $log | gzip - | ssh mysqluser@backupserver "cat - > /data/mysql/$dest_folder/ $backup_file" > /dev/null 2>&1