Bacula-users

Re: [Bacula-users] Feature idea feeler - bconsole "include / grep"

2010-05-09 23:29:52
Subject: Re: [Bacula-users] Feature idea feeler - bconsole "include / grep"
From: Norberto Meijome <numardbsd AT gmail DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Mon, 10 May 2010 13:26:51 +1000
(and to the list.. Apologies Gavin for private reply...)

On 7 May 2010 19:19, Gavin McCullagh <gavin.mccullagh AT gcd DOT ie> wrote:
On Thu, 06 May 2010, Steve Polyack wrote:

> These are certainly good points.  My thought is just that instead of
> breaking out of bconsole to perform these tasks can be cumbersome.
> Personally, I feel that it's something that I'd use a lot, simply to
> prevent me from constantly breaking in and out of the interactive
> bconsole session.  However, perhaps a solution would be to have bconsole
> parse the pipe character and feed output into the command that follows
> which could be any arbitrary *nix command (as opposed to
> writing/including our own version of grep).

For comparison, the Postgresql and MySQL command line interfaces include
something similar to this.

MySQL offers the "pager" command which can be set to "less" or "grep xxxx",
etc. as well as the tee command to also send output to a file.  Postgresql
offers a single:

         \o [FILE]      send all query results to file or |pipe

Neither allow anything as simple as

       SELECT ....... ; | grep blah


my $0.02,

Bconsole already performs SQL queries for all commands that would issue a long listing, right?

SQL was meant for filtering & relating data ... Why not add some filter param that is added to the SQL being sent to the backend? something like the original suggestion,but simply as an extra parameter to the existing command. for example:

*list files jobid=999 incFile="%budget%2009%" excFile="%.doc"

to include all *budget*2009* files, except *.doc .
Similar extensions:
 - case sensitive , or not.
 - paths instead of file
 - client names
 - etc

The tricky bit may be avoiding SQL injection attacks, but there should be some libraries / standard practices for dealing with this.

I think this may be a cleaner approach for then end user.

This may not apply if you have 1,000 clients, 'list clients' may not benefit from this as it doesnt query SQL...

B
_________________________
{Beto|Norberto|Numard} Meijome

"I detest people who take short­cuts rather than do things right, because they leave shit for the rest of us to clean up."
   PHK
------------------------------------------------------------------------------

_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users