Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors. [RESOLVED]

2008-02-06 Thread [EMAIL PROTECTED]

Hello again,

Incase anyone else ever needs it, this line will create a full sql dump 
of all databses from the local SQL server:


   RunBeforeJob="cmd /k mysqldump -uUSER 
-pPASS --all-databases -r C://DIR//FILE.sql" 

nb. you must create an empty text file eg. FILE.sql in the save 
location, this will be overwritten each time the command is run.



Thanks for all your help.

Dan



[EMAIL PROTECTED] wrote:

Thanks for the hellp guys!


Alan Brown wrote:
mysqlhotcopy can be used to copy out the tables in binary format if that's 
really wanted, but my experience is that the mysqldump table compresses 
_extremely_ well on tape.


Thanks Alan, I will look into that also. Though the db is not huge, and my boss 
and I agree with Dan, that text would be preferable. It just means that if all 
else fails the information is still there to be read.


  


Cesare Montresor wrote:

I have done some test fews days ago, try this use this shape:

Job
{
  ...
ClientRunBeforeJob = "cmd /k c:\\programmi\\bacula\\scripts\\before.bat"
  ...
}
  


Thanks Cesare, it still doesn't run the script though :( 

The really odd thing is that I have a delete script that works fine 
when Run Before or After the Job. Using the following format 
(RunAfterJob = "e:/backup/delete-bacula-catalog.bat") So I am pretty 
sure that its an issue with Bacula running xcopy which I am not using 
anymore anyway.


 Hopefully, mysqldump will solve all  :D


Thanks again, I'll post a solution once I get time to make one.  I got 
swamped yesterday, and haven't even looked at the man yet!



Dan


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/


___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users
  
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-06 Thread [EMAIL PROTECTED]


Thanks for the hellp guys!


Alan Brown wrote:
mysqlhotcopy can be used to copy out the tables in binary format if that's 
really wanted, but my experience is that the mysqldump table compresses 
_extremely_ well on tape.


Thanks Alan, I will look into that also. Though the db is not huge, and my boss 
and I agree with Dan, that text would be preferable. It just means that if all 
else fails the information is still there to be read.




Cesare Montresor wrote:

I have done some test fews days ago, try this use this shape:

Job
{
  ...
ClientRunBeforeJob = "cmd /k c:\\programmi\\bacula\\scripts\\before.bat"
  ...
}
  


Thanks Cesare, it still doesn't run the script though :( 

The really odd thing is that I have a delete script that works fine when 
Run Before or After the Job. Using the following format (RunAfterJob = 
"e:/backup/delete-bacula-catalog.bat") So I am pretty sure that its an 
issue with Bacula running xcopy which I am not using anymore anyway.


Hopefully, mysqldump will solve all  :D


Thanks again, I'll post a solution once I get time to make one.  I got 
swamped yesterday, and haven't even looked at the man yet!



Dan
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-06 Thread Dan Langille
Alan Brown wrote:
> On Tue, 5 Feb 2008, John Drescher wrote:
> 
>>>  @echo off
>>>  xcopy /y /q /k C:\MySQL\data\bacula E:\backup\bacula-database\
>>>  exit
>>>
>> Isn't there a mysqldump for windows? I do not think this is a good way
>> of backing up a database that is in use.
> 
> It isn't.
> 
> mysqlhotcopy can be used to copy out the tables in binary format if that's 
> really wanted, but my experience is that the mysqldump table compresses 
> _extremely_ well on tape.

I prefer and advocated dumping databases to text files if practical.  I 
prefer to know that I have a text backup of my data rather than a binary 
backup of my data.


-- 
Dan Langille - http://www.langille.org/
BSDCan - The Technical BSD Conference: http://www.bsdcan.org/
PGCon  - The PostgreSQL Conference:http://www.pgcon.org/

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-06 Thread Alan Brown
On Tue, 5 Feb 2008, John Drescher wrote:

>>  @echo off
>>  xcopy /y /q /k C:\MySQL\data\bacula E:\backup\bacula-database\
>>  exit
>>
> Isn't there a mysqldump for windows? I do not think this is a good way
> of backing up a database that is in use.

It isn't.

mysqlhotcopy can be used to copy out the tables in binary format if that's 
really wanted, but my experience is that the mysqldump table compresses 
_extremely_ well on tape.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-06 Thread Cesare Montresor
I have done some test fews days ago, try this use this shape:

Job
{
  ...
ClientRunBeforeJob = "cmd /k c:\\programmi\\bacula\\scripts\\before.bat"
  ...
}

Important things:
- "cmd /k"
- doubled slashes "\\"

Cesare Montresor


[EMAIL PROTECTED] wrote:
>
>  I am pretty sure the xcopy script IS failing. I just can't figure out 
> why.
>
>  If I use my DEL script in place of the xcopy script, it works like a 
> charm. Yet, if I run the xcopy batchfile manually it also completes 
> flawlessly. I would assume this is a permissions thing, but bacula was 
> installed under the Administrator account.
>
>  Having decided to use mysqldump, this is now all moot. I am playing 
> with mysqldump now, will let you know how it goes.
>
> Cheers for the help
>
> Dan
>
>
>
>
> John Drescher wrote:
>>>  I apologise for the confusion.
>>>
>>> 
>> Now I think I confused you.
>>
>>   
>>>   Thanks for the help though, I would have been testing everything twice
>>> otherwise!  lol
>>>
>>> 
>> Are you sure that the xcopy did not fail? I think the exit command
>> returns 0 regardless of the success or failure of the xcopy. Or am I
>> wrong about that?
>>
>> John
>>
>> -
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
>> ___
>> Bacula-users mailing list
>> Bacula-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
>>   
> 
>
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> 
>
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>   


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread [EMAIL PROTECTED]


I am pretty sure the xcopy script IS failing. I just can't figure out why.

If I use my DEL script in place of the xcopy script, it works like a 
charm. Yet, if I run the xcopy batchfile manually it also completes 
flawlessly. I would assume this is a permissions thing, but bacula was 
installed under the Administrator account.


Having decided to use mysqldump, this is now all moot. I am playing 
with mysqldump now, will let you know how it goes.


Cheers for the help

Dan




John Drescher wrote:

 I apologise for the confusion.



Now I think I confused you.

  

  Thanks for the help though, I would have been testing everything twice
otherwise!  lol



Are you sure that the xcopy did not fail? I think the exit command
returns 0 regardless of the success or failure of the xcopy. Or am I
wrong about that?

John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

  
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread John Drescher
>  I apologise for the confusion.
>
Now I think I confused you.

>
>   Thanks for the help though, I would have been testing everything twice
> otherwise!  lol
>
Are you sure that the xcopy did not fail? I think the exit command
returns 0 regardless of the success or failure of the xcopy. Or am I
wrong about that?

John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread [EMAIL PROTECTED]

I apologise for the confusion.

Thanks for the help though, I would have been testing everything twice 
otherwise!  lol



Dan




John Drescher wrote:

  However, I have been testing with simple files, so I didn't put the db at
risk. It seems that the targeted script is simply not run at all, the result
would be the same with any script wouldn't it?



I was under the assumption that the xcopy command failed because the
files that it was trying to copy were open.

John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

  
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread John Drescher
>   However, I have been testing with simple files, so I didn't put the db at
> risk. It seems that the targeted script is simply not run at all, the result
> would be the same with any script wouldn't it?
>
I was under the assumption that the xcopy command failed because the
files that it was trying to copy were open.

John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread [EMAIL PROTECTED]

Thanks :)

If the director is the machine with the database then you can use
RunBeforeJob otherwise you have to use ClientRunBeforeJob.
  


Awsome!  I could not find that anywhere :)



Isn't there a mysqldump for windows? I do not think this is a good way
of backing up a database that is in use


I  wasn't too sure about it either. I will use mysqldump instead.

However, I have been testing with simple files, so I didn't put the db 
at risk. It seems that the targeted script is simply not run at all, the 
result would be the same with any script wouldn't it?




Regards
Dan
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread John Drescher
On Feb 5, 2008 8:21 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>  Hi Guys
>
>   I am officially stumped.
>
>   I am trying to run a script before the job to copy the bacula db before
> backing it up. The batch script works when its clicked. But, whether I use
> the 'ClientRunBeforeJob' not 'RunBeforeJob', the files are not copied,
> despite a successful report from the run:
>
If the director is the machine with the database then you can use
RunBeforeJob otherwise you have to use ClientRunBeforeJob.

>   Below is my batch script, and the relevant entries from the dir.conf.  I
> would love it if someone could have a look and let me know where I have gone
> wrong. :(
>
>  backup-bacula-database.bat
>
>  @echo off
>  xcopy /y /q /k C:\MySQL\data\bacula E:\backup\bacula-database\
>  exit
>
Isn't there a mysqldump for windows? I do not think this is a good way
of backing up a database that is in use.

John

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] RunBeforeJob on Win32 fails with no errors.

2008-02-05 Thread [EMAIL PROTECTED]

Hi Guys

I am officially stumped.

I am trying to run a script before the job to copy the bacula db before 
backing it up. The batch script works when its clicked. But, whether I 
use the 'ClientRunBeforeJob' not 'RunBeforeJob', the files are not 
copied, despite a successful report from the run:


06-Feb 10:40 SERVER01-dir JobId 5: Start Backup JobId 5, 
Job=Server-Backup.2008-02-06_10.40.03

06-Feb 10:40 SERVER01-dir JobId 5: Using Device "FileStorage"
06-Feb 10:40 Server JobId 5: ClientRunBeforeJob: run command 
"e:/backup/backup-bacula-catalog.bat"
06-Feb 10:40 SERVER01-sd JobId 5: Volume "Server-0002" previously 
written, moving to end of data.
06-Feb 10:40 SERVER01-sd JobId 5: Ready to append to end of Volume 
"Server-0002" size=4261675176
06-Feb 10:40 SERVER01-sd JobId 5: Job write elapsed time = 00:00:10, 
Transfer rate = 12.77 K bytes/second
06-Feb 10:40 SERVER01-dir JobId 5: Bacula SERVER01-dir 2.2.7 (24Dec07): 
06-Feb-2008 10:40:32

 Build OS:   Linux Cross-compile Win32
 JobId:  5
 Job:Server-Backup.2008-02-06_10.40.03
 Backup Level:   Incremental, since=2008-02-06 10:37:51
 Client: "Server" 2.2.7 (24Dec07) Linux,Cross-compile,Win32
 FileSet:"Server" 2008-02-06 08:50:23
 Pool:   "Server" (From Job resource)
 Storage:"SERVER01-sd" (From Job resource)
 Scheduled time: 06-Feb-2008 10:40:17
 Start time: 06-Feb-2008 10:40:22
 End time:   06-Feb-2008 10:40:32
 Elapsed time:   10 secs
 Priority:   4
 FD Files Written:   8
 SD Files Written:   8
 FD Bytes Written:   126,283 (126.2 KB)
 SD Bytes Written:   127,732 (127.7 KB)
 Rate:   12.6 KB/s
 Software Compression:   None
 VSS:no
 Encryption: no
 Volume name(s): Server-0002
 Volume Session Id:  3
 Volume Session Time:1202253713
 Last Volume Bytes:  4,261,803,718 (4.261 GB)
 Non-fatal FD errors:0
 SD Errors:  0
 FD termination status:  OK
 SD termination status:  OK
 Termination:Backup OK

06-Feb 10:40 SERVER01-dir JobId 5: Begin pruning Jobs.
06-Feb 10:40 SERVER01-dir JobId 5: No Jobs found to prune.
06-Feb 10:40 SERVER01-dir JobId 5: Begin pruning Files.
06-Feb 10:40 SERVER01-dir JobId 5: No Files found to prune.
06-Feb 10:40 SERVER01-dir JobId 5: End auto prune.


Below is my batch script, and the relevant entries from the dir.conf.  
I would love it if someone could have a look and let me know where I 
have gone wrong. :(


_backup-bacula-database.bat_

@echo off
xcopy /y /q /k C:\MySQL\data\bacula E:\backup\bacula-database\
exit


_Dir.conf_

Director{
   Name=SERVER01-dir
   DIRport= 4
   QueryFile="C:\\Program 
Files\\Bacula\\bin\\query.sql"
   WorkingDirectory="C:\\Documents and 
Settings\\All Users\\Application Data\\Bacula\\Work"
   PidDirectory="C:\\Documents and 
Settings\\All Users\\Application Data\\Bacula\\Work"

   Maximum Concurrent Jobs=1
   Password="PASSWD"
   Messages=Daemon
   }
Storage{
   Name=SERVER01-sd
   Address=SERVER01
   SDPort= 6
   Password="PASSWD"
   Device=FileStorage
   Media Type=File
   }  
  
Console {

   Name=SERVER01-mon
   Password="PASSWD"
   CommandACL=status, .status
   }
JobDefs{
   Name="esite-backup"
   Type=Backup
   Storage=SERVER01-sd
   Schedule="DailyBackup"
   Messages=Standard
   Maximum Concurrent Jobs=1
   }

# production-Server 


Client {
   Name=production-Server
   Address=10.0.0.20
   FDPort=9
   Catalog=production-Server
   Password="PASSWD"
   }
Catalog{
   Name=production-Server
   DB Address=10.0.0.20
   dbname = bacula; user = bacula; password = "PASSWD"
   }
Pool{
   Name=Production-Server
   Label Format