>>>>> On Mon, 11 Dec 2006 13:44:27 +0100, Kern Sibbald said: > > On Monday 11 December 2006 12:26, Martin Simmons wrote: > > >>>>> On Fri, 8 Dec 2006 23:03:46 +0100, Kern Sibbald said: > > > > > > On Friday 08 December 2006 21:12, Martin Simmons wrote: > > > > >>>>> On Tue, 05 Dec 2006 11:51:22 -0500, Andrew Fabian said: > > > > > > > > > > Hello, > > > > > > > > > > I'm trying to write a script that tells bacula to restore job X to > > > > > client Y, which may not be the same client that job X came from. > > > > > > > > > > Currently, I'm doing this: > > > > > > > > > > [list of files to restore in filelist.txt] > > > > > > > > > > [tempfile]: > > > > > restore jobid=X client=Y where=/tmp/test file=<filelist.txt done yes > > > > > > > > > > bconsole <tempfile > > > > > > > > > > This is failing, and I can see from the queries that are being run > that > > > > > it's looking for each file from filelist.txt with the condition that > the > > > > > file was backed up by client Y, which is the client I want to restore > > > > > to, not the client the file came from. I think that by specifying > > > > > the > > > > > jobid explicitly, bacula has enough information to select the proper > > > > > files without being given the name of the client they came from. > > > > > > > > > > Any idea what I'm doing wrong? > > > > > > > > It's definitely a bug -- the command line parser deals with file= > > > > before > is > > > > has parsed client=. > > > > > > I don't think this is a bug unless I misunderstand the problem. Any > client > > > specified on the command line is the client from which the files were > backed > > > up. > > > > Hmmm, you are right, it does control the client used for some of the > > interactive options. > > > > > > > To specify a different client to which you want to restore, you must > specify > > > it using the mod option after the prompt. > > > > The following may be a bug then :-) The client option also sets the default > > destination client in the mod settings and hence the client used when no > other questions are asked. E.g. > > No, that is not a bug. In general, putting client=xxx on the command line > sets both the input and output client. In some cases, the client name is not > really needed to determine the input client, so the command line serves only > as the output client. In other cases, it will be used. > > > > > restore jobid=X client=Y where=/tmp/test all done yes > > > > will restore to Y regardless of the client used by jobid X. > > The current behavior is really a sort of mini-kludge because it is not very > evident to the user what is going on. Probably what we need is a different > keyword for the input and output client. Also the code has evolved quite a > lot over the past years, so all parts of it may not be totally consistent. > Most of this code will be rewritten or reorganized during the GUI project > after the release of 1.40.0
OK. My preference would be to make the client option be output-only to match the mod options. > By the way, in an earlier email, you referred to the command line scanner as > baroque. Could you explain what you would consider a non-baroque command > line scanner to be? The problem is that the keywords are all parsed by hand-crafted code, so it is difficult to tell what they are. It might be better to have a grammar or make it table driven like the config parser. My specific comment was about the list command, where some fraction of the options include a return statement while the others go round again for another pop. This causes jobid to be both a main keyword and a modifier (e.g. for jobmedia). __Martin ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users