deviantony / xtrabackup-scripts

Wrapper scripts (Python) for the Percona Xtrabackup tool.
http://www.percona.com/doc/percona-xtrabackup
110 stars 46 forks source link

Command output not cron friendly #4

Closed castro1688 closed 9 years ago

castro1688 commented 9 years ago

I've wrapped this script and added it to cron.d. However I have to send the output from /usr/local/bin/xb-backup-incremental.sh to /dev/null or I get the below message in my log file.

tput: No value for $TERM and no -T specified

Term is needed because of the color's and formatting from the output. Could it be possible to have a headless mode which removes the formatting?

deviantony commented 9 years ago

This is weird, I'm using the xb-backup-fs.sh script in cron.d and have no problem. What does your cronfile looks like?

castro1688 commented 9 years ago

root /usr/local/bin/xtrabackup_full >> /var/log/mysql/mysql-backup.log 2>&1

xtrabackup_full is my wrapper script, which has something like this:

/usr/local/bin/xb-backup-incremental.sh --log-file /var/log/mysql/mysql-backup.log --tmp-dir /backups/xtrabackup/tmp -r /backups/xtrabackup -u root --backup-threads 8 > /dev/null 2>&1

I'm piping that part to /dev/null currently because that suppresses the above mentioned errors.

deviantony commented 9 years ago

Why don't you just use the --log-file option in your cron file?

/usr/local/bin/xb-backup-incremental.sh --log-file /var/log/mysql/mysql-backup.log --tmp-dir /backups/xtrabackup/tmp -r /backups/xtrabackup -u root --backup-threads 8
deviantony commented 9 years ago

Should be fixed in 3.0.0b1 as it's not using a log formatting library anymore.