Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Heitor Faria

 That's an interesting suggestion.  I was worried the estimate
 command might be very slow but it seemed quick enough.  Perhaps a
 potential problem might be a difference between the estimate and
 actual bytes, perhaps because a large file was created in the
 interim.
 
 Another possibility occurred to me prompted by your idea... again
 in a RunBeforeJob script, label a fixed number of volumes (I can
 put a fairly accurate upper bound on the backup data size for each
 client) and after the job delete the volumes that were not used.
 I'm not immediately sure the best way to determine which weren't
 used but I think that won't be too hard.  I guess the risk here
 is that if the after job failed for some reason, the unused volumes
 would be left in the pool and would be used the next night.

Mr. McGraw: I know it's not you want but I got curious, if you wanna test...

create_volumes_before_job.sh:

Bytes=$(echo estimate job=BackupClient1 level=$Level | bconsole | sed 
'/bytes=/!d;s/^.*bytes=//;s/[.,]//g')
echo  Job total Bytes=$Bytes 
DVDs=$(bc  $Bytes / (4.4 * 1024 ^ 2))
echo  DVDs required=$DVDs 
for ((Counter=0; Counter=$DVDs; Counter++))
{
   echo label pool=Default storage=File1 volume=BackupClient1-$Counter 
|bconsole
   Counter=$((Counter + 1))
}

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Heitor Faria

--
Heitor Medrado de Faria
+55 61 82684220
Precisa de treinamento Bacula presencial, telepresencial ou online? Acesse: 
http://www.bacula.com.br


 Just an idea: you could use a RunBeforeJob Shell Script to create the
number of volumes needed to complete a job. Something like that:

 echo estimate job=BackupClient1 level=${Level} |bconsole |grep -o
-P 'bytes.{0,16}'

 Then clear the bytes= from the result, divide per 4.4Gb (?) and than
create the needed volumes:

 echo label pool=${Pool} storage=${Storage}
volume=-shell-variable |bconsole

 The full solution requires shell script knowledge that I don't have,
but I think it's the closest thing to the Python script you had.
 Good luck.

That's an interesting suggestion.  I was worried the estimate
command might be very slow but it seemed quick enough.  Perhaps a
potential problem might be a difference between the estimate and
actual bytes, perhaps because a large file was created in the
interim.

Another possibility occurred to me prompted by your idea... again
in a RunBeforeJob script, label a fixed number of volumes (I can
put a fairly accurate upper bound on the backup data size for each
client) and after the job delete the volumes that were not used.
I'm not immediately sure the best way to determine which weren't
used but I think that won't be too hard.  I guess the risk here
is that if the after job failed for some reason, the unused volumes
would be left in the pool and would be used the next night.

You can run an AfterJob script even if job fails. I think it's the RunOnError 
option.

Best regards.


--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Heitor Faria
* DVDs=$(bc  $Bytes / (4724464025.6 ^ 2))

== 
Heitor Medrado de Faria - LPIC-III | ITIL-F 
02 a 13 de Março - Novo Treinamento Telepresencial Bacula: 
http://www.bacula.com.br/?p=2174 
61 8268-4220 
Site: www.bacula.com.br | Facebook: heitor.faria | Gtalk: heitorfa...@gmail.com 
=== 


- Mensagem original -
 De: Heitor Faria hei...@bacula.com.br
 Para: S McGraw smcg2...@frii.com
 Cc: bacula-users@lists.sourceforge.net
 Enviadas: Sexta-feira, 27 de fevereiro de 2015 11:08:23
 Assunto: Re: [Bacula-users] Status of Python api?
 
 
  That's an interesting suggestion.  I was worried the estimate
  command might be very slow but it seemed quick enough.  Perhaps a
  potential problem might be a difference between the estimate and
  actual bytes, perhaps because a large file was created in the
  interim.
  
  Another possibility occurred to me prompted by your idea... again
  in a RunBeforeJob script, label a fixed number of volumes (I can
  put a fairly accurate upper bound on the backup data size for each
  client) and after the job delete the volumes that were not used.
  I'm not immediately sure the best way to determine which weren't
  used but I think that won't be too hard.  I guess the risk here
  is that if the after job failed for some reason, the unused volumes
  would be left in the pool and would be used the next night.
 
 Mr. McGraw: I know it's not you want but I got curious, if you wanna test...
 
 create_volumes_before_job.sh:
 
 Bytes=$(echo estimate job=BackupClient1 level=$Level | bconsole | sed
 '/bytes=/!d;s/^.*bytes=//;s/[.,]//g')
 echo  Job total Bytes=$Bytes 
 DVDs=$(bc  $Bytes / (4.4 * 1024 ^ 2))
 echo  DVDs required=$DVDs 
 for ((Counter=0; Counter=$DVDs; Counter++))
 {
echo label pool=Default storage=File1 volume=BackupClient1-$Counter
|bconsole
Counter=$((Counter + 1))
 }
 
 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users
 

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Victor Hugo dos Santos
On Thu, Feb 26, 2015 at 10:06 PM, S McGraw smcg2...@frii.com wrote:
 On 02/26/2015 03:08 PM, Heitor Faria wrote:
 [...] I was auto-labeling the volumes for each job like:
 xxx-1.bac, xxx-2.bac, xxx-n.bac, etc where n starts at 1
 for each job. Is there some variable that has that behavior?
 [...]

 Hey Mr. McGraw: you should try LabelFormat =
 xxx-${NumVols}.bac What is xxx? If is the client name you can
 uses ${Client}. You could check all Bacula Variables via Google:
 http://www.bacula.org/5.2.x-manuals/en/misc/misc/Variable_Expansion.html

   Thanks for that suggestion.  I read the Variable Expansion
 chapter many times but interpreted current number of Volumes in
 the Pool as being a fixed number for a pool with a large number of
 pre-labeled volumes.

 I just tried using NumVols but the number it produced was 5177. I
 guess was wrong about the pre-labeled part but it does seem to be
 total number of volumes in the pool and not a number for the
 volumes used in the current job so far which is what I need.

 1. Sorry for misunderstanding it. I really don't see the need of
 associating volumes names with their jobs and it can be very messy
 when they are recycled,  since a Job can take a variable amount of
 volumes and Bacula already provide that association (e.g: list
 jobmedia, restore job..., etc.).

 I agree it is messy (I would say unworkable) when recycling is
 used but I don't do recycling.

 I backup to smaller-than-DVD sized disk volumes and write those
 to DVD.  In such an environment, volume recycling is pointless.

 All post-bacula handling (write to DVD, off-siting, moving
 storage locations around to fit varying storage needs/capacities,
 etc) are done by hand or with the help of scripts since Bacula
 provides no support for DVD as a storage medium.  I find it
 easier to manage those tasks when I can look at filename and
 be able to determine information about what is in the volume
 than to have to go though a level of indirection for that information,
 either by asking Bacula or querying the catalog database directly.
 And of course the current labeling scheme is baked into the
 scripts that I have to help with the post-bacula volume management.

 I've been using the current labeling scheme successfully for
 5 years, including disaster recovery simulation so I don't see
 a strong reason to change now unless I have to.


Hi,

are you sure that you cant configure bacula to make a backup direct to DVD ???
I have one client configured to use a DVD storage just now.

basicaly, I backup all information from clients to internal bacula
disk and after this I make a job copy to DVD (internal disk to DVD).


about the label name, if the idea is just to make easy to manual
select the volume... maybe you can use:
Client_name-Date-JodID

good luck



-- 
--
Victor Hugo dos Santos
http://www.vhsantos.net
Linux Counter #224399

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Confused: Volume, Storage, Pool, Job

2015-02-27 Thread John Drescher
 For tapes each tape is a volume. Also recycling does not work if you
 only have 1 volume. This includes disk based storage.

Recycling does not work with a single volume in a pool because
recycling is an entire volume or none even on disk based storage.

John

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Confused: Volume, Storage, Pool, Job

2015-02-27 Thread Heitor Faria
 Pool may contain many volumes. What's the advantage of multiple volumes in a
 pool?
 Volume: is a label of a storage in a pool. What's the purpose of a volume?
 Why the Job resource has a pool and a storage attributes, it's supposed to
 have only the pool attributes!

I hope you can get some clarification on the 3rd lesson (it's open): 
https://www.udemy.com/bacula-backup-software/?dtcode=Gbsc4TG2tfWb

Regards,
== 
Heitor Medrado de Faria - LPIC-III | ITIL-F 
02 a 13 de Março - Novo Treinamento Telepresencial Bacula: 
http://www.bacula.com.br/?p=2174 
61 8268-4220 
Site: www.bacula.com.br | Facebook: heitor.faria | Gtalk: heitorfa...@gmail.com 
===

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Dimitri Maziuk
On 02/27/2015 09:59 AM, Heitor Faria wrote:
 
 ... [I] ponder if it might be worthwhile to rethink the way I am
 doing backups.

 How much manual work is involved and how much is the time of whoever
 does it worth? E.g. RDX might me cheaper. Or BackupPC.
 
 [2] Or hiring a VPS (e.g.: www.chicagovps.net) and install a bacula-sd on it. 
 =)

I expect Amazon VTL is even better, but I don't think that gives you
physical DVDs.

As I understand it, sending BackupPC's archive job to a DVD is
trivial, except you still have to put the disk in the drive -- dep. on
how often you do that, RDX may be a better option.

-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu



signature.asc
Description: OpenPGP digital signature
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Confused: Volume, Storage, Pool, Job

2015-02-27 Thread jalil1408
Exemple:

Job {
  Name = Job1
  Type = Backup
  Level = Full
  Client = vm-omv-fd
  FileSet = FileSet1
  Schedule = Schedule1
  Storage = Storage1
  Pool = Pool1
  Messages = Message1
}


Pool may contain many volumes. What's the advantage of multiple volumes in a 
pool?
Volume: is a label of a storage in a pool. What's the purpose of a volume?
Why the Job resource has a pool and a storage attributes, it's supposed to have 
only the pool attributes!

+--
|This was sent by jalil1...@gmail.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Confused: Volume, Storage, Pool, Job

2015-02-27 Thread John Drescher
On Sun, Feb 22, 2015 at 8:00 AM, jalil1408
bacula-fo...@backupcentral.com wrote:
 Exemple:

 Job {
   Name = Job1
   Type = Backup
   Level = Full
   Client = vm-omv-fd
   FileSet = FileSet1
   Schedule = Schedule1
   Storage = Storage1
   Pool = Pool1
   Messages = Message1
 }


 Pool may contain many volumes. What's the advantage of multiple volumes in a 
 pool?

For tapes each tape is a volume. Also recycling does not work if you
only have 1 volume. This includes disk based storage.

John

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Dimitri Maziuk
On 2015-02-26 19:06, S McGraw wrote:

 All post-bacula handling (write to DVD, off-siting, moving
 storage locations around to fit varying storage needs/capacities,
 etc) are done by hand or with the help of scripts

 ... [I] ponder if it might be worthwhile to rethink the way I am
 doing backups.

How much manual work is involved and how much is the time of whoever 
does it worth? E.g. RDX might me cheaper. Or BackupPC.

Dimitri



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Status of Python api?

2015-02-27 Thread Heitor Faria

  All post-bacula handling (write to DVD, off-siting, moving
  storage locations around to fit varying storage needs/capacities,
  etc) are done by hand or with the help of scripts
 
  ... [I] ponder if it might be worthwhile to rethink the way I am
  doing backups.
 
 How much manual work is involved and how much is the time of whoever
 does it worth? E.g. RDX might me cheaper. Or BackupPC.

[2] Or hiring a VPS (e.g.: www.chicagovps.net) and install a bacula-sd on it. =)
 
 Dimitri
 
 

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Runscript - fail job on error

2015-02-27 Thread Luc Van der Veken
While testing something, I ran into this (director version 5.2.5, Ubuntu 12.04, 
client is an Ubuntu 14.04 running fd version 5.2.6).

Shouldn't Fail job on error = No have made it continue regardless of the 
error?

  RunScript {
Command = /etc/bacula/scripts/pre_backup.sh %l
Runs on Client = Yes
Runs When = Before
Runs On Success = Yes
Runs On Failure = Yes
Fail job on error = No
  }

I had a syntax error in the script, and got this in the log:

2015-02-27 14:48:05   git-luc-fd JobId 26973: Error: Runscript: 
ClientRunBeforeJob returned non-zero status=2. ERR=Child exited with code 2
2015-02-27 14:48:05   bacula-dir JobId 26973: Fatal error: Bad response to 
ClientRunBeforeJob command: wanted 2000 OK RunBefore
, got 2905 Bad RunBeforeJob command.
2015-02-27 14:48:05   bacula-dir JobId 26973: Fatal error: Client git-luc-fd 
RunScript failed.
[...]
Start time: 27-Feb-2015 14:48:04
  End time:   27-Feb-2015 14:48:05
  Elapsed time:   1 sec
  Priority:   10
  FD Files Written:   0
  SD Files Written:   0
  FD Bytes Written:   0 (0 B)
  SD Bytes Written:   0 (0 B)
  Rate:   0.0 KB/s

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] FIFO Backup Questions

2015-02-27 Thread Heitor Faria
Dear Bacula Users, 

1. Why FIFO isn't more popular for database dumps backups? Is there any 
drawback? 
2. I inserted RedFifo=yes on FileSet Options and configured a simple 
RunBeforeJob script (below) to test FIFO backup, but the backup job stalls 
waitng for script termination. Am I missing something? 



[ -p /tmp/tubo ] ||mkfifo /tmp/tubo 
ls -l  /tmp/tubo 

Regards, 
== 
Heitor Medrado de Faria - LPIC-III | ITIL-F 
02 a 13 de Março - Novo Treinamento Telepresencial Bacula: 
http://www.bacula.com.br/?p=2174 
61 8268-4220 
Site: www.bacula.com.br | Facebook: heitor.faria | Gtalk: heitorfa...@gmail.com 
=== 

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] FIFO Backup Questions

2015-02-27 Thread Heitor Faria
  Dear Bacula Users,
 

  1. Why FIFO isn't more popular for database dumps backups? Is there any
  drawback?
 
  2. I inserted RedFifo=yes on FileSet Options and configured a simple
  RunBeforeJob script (below) to test FIFO backup, but the backup job stalls
  waitng for script termination. Am I missing something?
 

 The FIFO special file created by mkfifo will block for read or write until
 both ends of the FIFO are opened. See man mkfifo(3).
Thanks Josh, I'm aware. I think that's why ReadFifo option exists on Bacula: 

readfifo=yesno If enabled, tells the Client to read the data on a backup and 
write the data on a restore to any FIFO (pipe) that is explicitly mentioned in 
the FileSet. In this case, you must have a program already running that writes 
into the FIFO for a backup or reads from the FIFO on a restore. This can be 
accomplished with the RunBeforeJob directive. If this is not the case, Bacula 
will hang indefinitely on reading/writing the FIFO. When this is not enabled 
(default), the Client simply saves the directory entry for the FIFO. 

Unfortunately, when Bacula runs a RunBeforeJob, it waits until that script 
terminates, and if the script accesses the FIFO to write into the it, the 
Bacula job will block and everything will stall. However, Vladimir Stavrinov as 
supplied tip that allows this feature to work correctly. He simply adds the 
following to the beginning of the RunBeforeJob script: 
exec  /dev/null 
Ps.: I tried the exec  /dev/null 

  [ -p /tmp/tubo ] ||mkfifo /tmp/tubo
 
  ls -l  /tmp/tubo
 

 --
 Dive into the World of Parallel Programming The Go Parallel Website,
 sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for
 all
 things parallel software development, from weekly thought leadership blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users
--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] FIFO Backup Questions

2015-02-27 Thread Josh Fisher


On 2/27/2015 4:59 PM, Heitor Faria wrote:

Dear Bacula Users,

1. Why FIFO isn't more popular for database dumps backups? Is there 
any drawback?
2. I inserted RedFifo=yes on FileSet Options and configured a simple 
RunBeforeJob script (below) to test FIFO backup, but the backup job 
stalls waitng for script termination. Am I missing something?


The FIFO special file created by mkfifo will block for read or write 
until both ends of the FIFO are opened. See man mkfifo(3).




[ -p /tmp/tubo ] ||mkfifo /tmp/tubo
ls -l  /tmp/tubo




--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users