Subject Re: is Service Manager Backup Service finished?
Author Adam
--- In firebird-support@yahoogroups.com, Eduardo Resek <eresek@y...>
wrote:
>
> Hello Adam,
>
>
> There is a method in TIBBackupService that allows you to check the
> progress of backup: it's EOF.
>
> I have cut a simplified excerpt from a program of mine, which I'm
listing here.
> There are some strange elements in it, but I think they shoud have
an
> obious meaning (user.text is the content of a TEdit named user, etc)
>
>
> ////////////////////////// begin listing //////////////////////
>
> with IBBackupService do begin
> //fill in parameters
> ServerName := '';
> LoginPrompt := False;
> params.Clear;
> Params.Add('user_name='+user.Text);
> Params.Add('password='+pass.Text);
> Active := True;
> Verbose := false;
> Options := [NonTransportable, IgnoreLimbo];
> DatabaseName := dbfile.Text;
> BackupFile.Clear;
> BackupFile.Add(TargetFile);
> //start backup
> ServiceStart;
> //wait for it
> While not Eof do begin
> temp:=GetNextLine;
> if temp<>'' then
> memoMessages.Lines.Add(temp);
> Application.ProcessMessages;
> end;
> //when it gets through here, it's done!
> memoMessages.Lines.Add('Finished!');
> Application.ProcessMessages;
> Active := False;
> end;
>
> ////////////////////////// end of listing //////////////////////
>
>
> --
> HIH,

Thanks Eduardo,

I will take a look at this tomorrow. I already have the program
working now by basically checking for a file system lock on the fbk
file in a loop until it returns false (with sleep so it does not
hammer the CPU and disk). This works fine but of course I would
prefer to do it the other way.

Adam