Implement option to suppress informational messages

Bug #1087663 reported by Daniel Bond
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Percona XtraBackup moved to https://jira.percona.com/projects/PXB
Triaged
Wishlist
Unassigned
2.0
Won't Fix
Undecided
Unassigned
2.1
Triaged
Wishlist
Unassigned
2.2
Triaged
Wishlist
Unassigned
2.3
Triaged
Wishlist
Unassigned

Bug Description

Xtrabackup prints information like:

[01] Copying ./mydatabase/messages_279.ibd to /mnt/backup/xtrabackup_2012-12-07/./mydatabase/messages_279.ibd

to STDERR instead of STDERR. Programs should allways write general-purpose output to STDOUT, and write warnings and errors to STDERR. This makes programs work well with the UNIX idioms, like pipes and crontab.

In example I wish to run a xtrabackup-script from crontab, and have crontab only send messages if warnings or error occur (by redirecting STDOUT to /dev/null). It might also be handy to use tools like "less" on the output.

It would be very nice to see this script updated to use STDOUT for informal messages, and STDERR for errors. It would provide much better flexibility, and co-operate well with other UNIX tools / UNIX environment.

affects: percona-server → percona-xtrabackup
Revision history for this message
Alexey Kopytov (akopytov) wrote :

The behavior to write all diagnostic messages, both informational and errors, is intentional and has been implemented as a part of fixes for bug #733663 and bug #514068.

Streaming backups allow piping backup data to other utilities, which is another established UNIX idiom. Which means writing any messages to STDOUT would create a broken backup stream. It is similar to tar, for example, which writes all messages generated by the '-v' option to STDERR, even if they are not errors, for exactly the same reason: STDOUT may also be the archive destination.

Changed in percona-xtrabackup:
status: New → Invalid
Revision history for this message
Daniel Bond (daniel-bond) wrote :

I see, I didn't think about uses without the --target-dir. It makes more sense now. Thanks a lot for the quick response, and all the great efforts the Percona team has been putting into percona server and xtradb.

Changed in percona-xtrabackup:
status: Invalid → Incomplete
status: Incomplete → Invalid
status: Invalid → Opinion
Revision history for this message
Daniel Bond (daniel-bond) wrote :

Perhaps it would still be possible to please everyone, by adding an "--quiet" or "--errors-only" flag, which supresses informal messages from STDERR?

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Agree, an option to suppress information messages may be useful in some cases.

Let's keep this bug as a request to add the "--quiet" option to only print error messages. I think it should be disabled by default, as extended diagnostics is important (and often the only available information) in problem resolution.

Changed in percona-xtrabackup:
status: Opinion → Triaged
importance: Undecided → Low
summary: - Xtrabackup prints informal messages to STDERR not STDOUT
+ Implement option to suppress informational messages
Revision history for this message
Daniel Bond (daniel-bond) wrote :

Great! :-)

Changed in percona-xtrabackup:
importance: Low → Wishlist
Revision history for this message
jessy (bjoern-boschman) wrote :

any news on this?
having a --quiet option would be really great for crontab backup usage

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PXB-88

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.