Not the answer you need? Try our search, browse our categories, or register and ask your own question!

How to log streaming backup

pythondev1pythondev1 EntrantActive Member Contributor
I am changing my backups to streaming and tar'ing them up.


dest="streaming_current_backup/";
dest2="streaming_current_backup"
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.

Comments

  • vaibhav_upadhyay40vaibhav_upadhyay40 Contributor Active Member Mentor
    Hi @pythondev1
    Try this,
    xtrabackup --backup --stream=tar --target-dir=$dest > "$dest2/backup.tar" >> log.txt 2>&1

    Hope this helps.
  • pythondev1pythondev1 Entrant Active Member Contributor
    Thanks I tried something similar and it worked.
  • vaibhav_upadhyay40vaibhav_upadhyay40 Contributor Active Member Mentor
    Happy to know @pythondev1 you found the solution. May be you can share in your comment. It will be helpful for other
    users. :) 

  • pythondev1pythondev1 Entrant Active Member Contributor
    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 [email protected] "cat - > /data/mysql/$dest_folder/ $backup_file" > /dev/null 2>&1




Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.