Re: [Bacula-users] Running complex commands or scripts remotely on a client

2012-09-06 Thread Alex Lucas
On 06/09/12 16:39, Simone Caronni wrote:
>> You could also use multiple ClientRunBefore statements in the config file. 
>> Personally I would still prefer a script in the client.
> On my setups I use the opposite. If you need to add a line to the
> script, you need to copy the same script over all the clients. With
> multiple lines, maybe you can change just one line in the Job
> Definition.
>
> Don't know how many you have in your backup infrastructure, but that's
> not feasible at all in our setup; especially because the clients and
> daemons are separated by firewalls and do not allow easy copying
> everywhere.
Thank you everybody for your answers,
I now use ";" to separate shell commands on one line and if I reach the
limit then add more ClientRunBefore commands.
As mentioned by Simone, it's not easy to deploy scripts to 100s of
machines, so... :)


>
> Regards,
> --Simone
>
>
>



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Running complex commands or scripts remotely on a client

2012-09-05 Thread Alex Lucas
On 06/09/12 12:10, ganiuszka wrote:
> W dniu 06.09.2012 03:23, Alex Lucas pisze:
>> On 05/09/12 19:24, Christian Manal wrote:
>>> On 05.09.2012 12:43, Alex Lucas wrote:
>>>> Dears,
>>>>
>>>> Is there a way to run a complex command or even a script on a client?
>>>>
>>>> So far I have tried two ways and failed:
>>>> 1) when a command (e.g. in "ClientRunBeforeJob") has something like
>>>> "echo test > /tmp/test.out" bacula runs it on the client as "echo" as
>>>> command and the rest as the argument. i.e. there is no
>>>> /tmp/test.out on
>>>> the client
>>>> 2) when I run "test.sh" which is in the PATH on the bacula director it
>>>> fails, I guess because there is no identical script on the client.
>>>>
>>>> Any suggestions?
>>> Hi,
>>>
>>> all the Run-statements execute what is defined directly, without a
>>> shell. So output redirection and stuff won't work unless you do
>>> something like this:
>>>
>>> ClientRunBeforeJob = "/bin/bash -c 'echo foo >/tmp/foo.out'"
>> Thank you, this does it. One related question: is because I have a few
>> commands to run, is there a way to make the commands split across
>> several lines (for readability) ?
>>
>> e.g.
>>
>> ClientRunBeforeJob = "/bin/bash -c 'command one
>>command two'"
>>
>> doesn't seem to work.
>
> Hi,
>
> It works for me. Did you try to use semicolon character for separate
> elementary commands?
>
> Example:
>
> ClientRunBeforeJob = "/bin/bash -c 'echo aaa >/tmp/foo1.out; echo bbb
> > /tmp/foo2.out'"
Hi gani,
It works with ";" like you mentioned above but I was asking about
splitting the command across multiple lines in the configuration file --
when there are many commands it would make it easier to read.

Thank you,
Alex

>
> Regards.
> gani


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Running complex commands or scripts remotely on a client

2012-09-05 Thread Alex Lucas
On 05/09/12 19:24, Christian Manal wrote:
> On 05.09.2012 12:43, Alex Lucas wrote:
>> Dears,
>>
>> Is there a way to run a complex command or even a script on a client?
>>
>> So far I have tried two ways and failed:
>> 1) when a command (e.g. in "ClientRunBeforeJob") has something like
>> "echo test > /tmp/test.out" bacula runs it on the client as "echo" as
>> command and the rest as the argument. i.e. there is no /tmp/test.out on
>> the client
>> 2) when I run "test.sh" which is in the PATH on the bacula director it
>> fails, I guess because there is no identical script on the client.
>>
>> Any suggestions?
> Hi,
>
> all the Run-statements execute what is defined directly, without a
> shell. So output redirection and stuff won't work unless you do
> something like this:
>
>ClientRunBeforeJob = "/bin/bash -c 'echo foo >/tmp/foo.out'"
Thank you, this does it. One related question: is because I have a few
commands to run, is there a way to make the commands split across
several lines (for readability) ?

e.g.

ClientRunBeforeJob = "/bin/bash -c 'command one
  command two'"

doesn't seem to work.

>
> If you want to call a script, you'd have to define the absolute path or
> a relative one from the executing daemon's working directory.
>
>
> Regards,
> Christian Manal
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Running complex commands or scripts remotely on a client

2012-09-05 Thread Alex Lucas
Dears,

Is there a way to run a complex command or even a script on a client?

So far I have tried two ways and failed:
1) when a command (e.g. in "ClientRunBeforeJob") has something like
"echo test > /tmp/test.out" bacula runs it on the client as "echo" as
command and the rest as the argument. i.e. there is no /tmp/test.out on
the client
2) when I run "test.sh" which is in the PATH on the bacula director it
fails, I guess because there is no identical script on the client.

Any suggestions?


Thank you,
Alex

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Multi-stream data transfer

2012-06-07 Thread Alex Lucas
On 08/06/12 11:14, Bryan Harris wrote:
>
> On Jun 7, 2012, at 9:51 PM, Alex Lucas wrote:
>
>> Is there a way to setup multi-stream data transfer?/
>> /
>
> I wonder if you could configure two separate jobs and connect to the
> same FD twice?
Only 1 big file is being backed up so splitting the job is not possible
(also checked disk performance on FD, can read the file at >100MB/s). Is
there not an option in Bacula for FD to create multiple TCP streams to
SD (instead of 1) ?

>
> Bryan

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Multi-stream data transfer

2012-06-07 Thread Alex Lucas
Dears,

Is there a way to setup multi-stream data transfer?

/Background/: The backup is disk to disk over a dedicated WAN 2M link.
We have tested the link with iperf and can get maximum speed out of it
(when using >10 concurrent connections). Our current bacula fd-->sd
speed is averaging at 1Mbps (only about half of the available
bandwidth). Tried compression on/off - no noticeable difference. Note:
speed of backup observed with mrtg, iptraf, dstat etc.

Regards,
Alex
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Last full backup not found

2012-05-27 Thread Alex Lucas
On 28/05/12 00:50, Henrik Zawischa - SONIC Performance Support wrote:
> I added three new jobs, two new pools and one fileset. But I kept that one 
> job as it was. I checked and noticed the last incremental backup failed due 
> to an error of the autochanger. Could that be the reason? How does bacula 
> determine what it has to do? I would have thought a failed job should just 
> mean twice as much to save the next day.
Failed incrementals should not prevent restore.

from sql mode in bconsole
select jobid, name, level, starttime, jobstatus from job where name =
'YOURJOBNAME';

scroll now to top and see if there is a job with jobstatus = 'T' and
level = 'F'


>
> Henrik
>
>
> Henrik Zawischa
> Senior System Engineer
>
>
>
> SONIC Performance Support GmbH
> Wandsbeker Königstraße 19 - D22041 Hamburg
>
> Tel.: +49 40 300 600 34
> Fax: +49 40 300 600 18
> E-Mail: henrik.zawis...@sonic-ps.de
> Web: www.sonic-performance-support.com
>
> Facebook: www.facebook.com/SONICVideoTraining
> YouTube: http://www.youtube.com/SONICVideoTraining
> Twitter: www.twitter.com/VideoTraining
>
>  
> Von: John Drescher [dresche...@gmail.com]
> Gesendet: Sonntag, 27. Mai 2012 18:03
> Bis: Henrik Zawischa - SONIC Performance Support
> Cc: bacula-users@lists.sourceforge.net
> Betreff: Re: [Bacula-users] Last full backup not found
>
>> I have a strange phenomenon: though there is definitely a full backup, a
>> job set to incremental claims there weren’t and wants to run a full backup.
>> Very unfortunate, as the tapes needed are not in place. Any idea how I could
>> find out what went wrong?
>>
> Did you modify the job or fileset since the last full backup?
>
> John
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Partial FileSet encryption

2012-05-24 Thread Alex Lucas
On 24/05/12 20:15, Bryan Harris wrote:
> On May 24, 2012, at 2:13 AM, Alex Lucas wrote:
>
>> Greetings,
>>
>> The docs seem to be conflicting about data encryption with Bacula.
>>
>> http://www.bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#SECTION001813
>> Here there is a mention that it should be possible to encrypt at the
>> FileSet level (allowing one to choose what to encrypt and what not to).
>>
>> While here
>> (http://www.bacula.org/5.0.x-manuals/en/main/main/Data_Encryption.html)
>> it seems to be on a client (FD) level, i.e. "all or nothing".
>>
>> Please clarify.
> Is it possible they are talking about an upcoming feature or maybe in the 
> enterprise edition or undocumented?
Perhaps, I somehow remember reading about this issue on a third party
website but cannot find the article anymore.

>
> I can't find the word "encryption" on the Configuring_Director.html page 
> anywhere but in one place.  However, I look all through the FileSet options 
> and don't see anything about encryption.
Yes, exactly.
"/The FileSet Resource/
The FileSet resource defines what files are to be included or excluded
in a backup job various backup options such as compression,
/encryption/, and signatures that are to be applied to each file."
Compression -- true, but as for encryption.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Partial FileSet encryption

2012-05-24 Thread Alex Lucas
Greetings,

The docs seem to be conflicting about data encryption with Bacula.

http://www.bacula.org/5.0.x-manuals/en/main/main/Configuring_Director.html#SECTION001813
Here there is a mention that it should be possible to encrypt at the
FileSet level (allowing one to choose what to encrypt and what not to).

While here
(http://www.bacula.org/5.0.x-manuals/en/main/main/Data_Encryption.html)
it seems to be on a client (FD) level, i.e. "all or nothing".

Please clarify.

Best regards,
Alex

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Why all my volumes get marked as purged??

2012-05-14 Thread Alex Lucas
On 12/05/12 01:44, Martin Simmons wrote:
>>>>>> On Thu, 10 May 2012 18:49:15 +0800, Alex Lucas said:
>> Dears,
>>
>> This started happening recently:
>> I run a job and it finishes. Can see it in list jobs and related volume
>> in list volumes.
>> I then run another job in 2 minutes -- the volume from the first job
>> gets auto-pruned!
>>
>> All my retentions are set to 90 days (file, job and volume) and I have
>> not changed them since beginning.
> Is it definitely 90 days and not 90 seconds? :-)
Yes, 90 days :)
I figured out why it was purging -- every time one or more of previous
jobs had 0 files in the last incremental (i.e. "no changes") Bacula
would auto-purge the volume(s) in catalog (we have one job per volume).


>
> __Martin
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] One Volume per Backup Job

2012-05-10 Thread Alex Lucas
On 10/05/12 19:53, John Drescher wrote:
> On Thu, May 10, 2012 at 3:50 AM, Alex Lucas
>  wrote:
>> Dears,
>>
>> I was trying to get one volume per job with this pool configuration:
>>
>> Pool {
>>  Name = File
>>  Pool Type = Backup
>>  Recycle = no   # Bacula can automatically recycle Volumes
>>  AutoPrune = yes# Prune expired volumes
>>  Volume Retention = 90 days # how long to keep volumes
>>  Maximum Volume Bytes = 4G  # Limit Volume size to something reasonable
>>  Maximum Volume Jobs = 1# One job per volume
>>  LabelFormat =
>> "${Client}_${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}h${Minute:p/2/0/r}m_${Level:o0-4:l}"
>>  Next Pool = VirtualFull
>> }
>>
>> It works well for jobs that complete successfully - volumes get created
>> properly and get marked as "Used" open backup completion. However there
>> are 2 problems when jobs fail:
>>
>> Example: I run job for JKT-nvr but the fd on it is not running - I get
>> job timeout but the following entry in 'list volumes':
>> | 1050| JKT-nvr-fd_2012-05-10_15h35m_full | Append| 1
>> | 0  | 0| 7776000  | 0   | 0| 0 |
>> File  | 0   |
>>
>> Next time I run a job (does not matter with which client) director will
>> try to use the volume above instead of creating a brand new one. Even if
>> I re-run the previous job for the same client I would like it to create
>> a new volume (since date/time are also in the LabelFormat).
>>
> It will do that because there is an available volume in the pool so it
> need not create a new one. Also remember changing the pool definition
> in bacula-dir.conf will only effect new volumes not existing volumes.
> The pool resource is a template on how to create new volumes.
Yes, this is clear.

>> How to archive one of the following for failed backup jobs:
>> a) mark auto-created volume as "Used", OR
>> b) delete the auto-created volume
>>
> Just mark the existing volume Used or Full.
How to do this? I tried RunAfterFailedJob just but %v variable is empty
on failed jobs even though the volume does get created and left in the
"Append" state. This is not a bug?

>
> John
Thanks,
Alex


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Why all my volumes get marked as purged??

2012-05-10 Thread Alex Lucas
Dears,

This started happening recently:
I run a job and it finishes. Can see it in list jobs and related volume
in list volumes.
I then run another job in 2 minutes -- the volume from the first job
gets auto-pruned!

All my retentions are set to 90 days (file, job and volume) and I have
not changed them since beginning.

Regards,
Alex

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] One Volume per Backup Job

2012-05-10 Thread Alex Lucas
Dears,

I was trying to get one volume per job with this pool configuration:

Pool {
  Name = File
  Pool Type = Backup
  Recycle = no   # Bacula can automatically recycle Volumes
  AutoPrune = yes# Prune expired volumes
  Volume Retention = 90 days # how long to keep volumes
  Maximum Volume Bytes = 4G  # Limit Volume size to something reasonable
  Maximum Volume Jobs = 1# One job per volume
  LabelFormat =
"${Client}_${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}h${Minute:p/2/0/r}m_${Level:o0-4:l}"
  Next Pool = VirtualFull
}

It works well for jobs that complete successfully - volumes get created
properly and get marked as "Used" open backup completion. However there
are 2 problems when jobs fail:

Example: I run job for JKT-nvr but the fd on it is not running - I get
job timeout but the following entry in 'list volumes':
| 1050| JKT-nvr-fd_2012-05-10_15h35m_full | Append| 1  
| 0  | 0| 7776000  | 0   | 0| 0 |
File  | 0   |

Next time I run a job (does not matter with which client) director will
try to use the volume above instead of creating a brand new one. Even if
I re-run the previous job for the same client I would like it to create
a new volume (since date/time are also in the LabelFormat).

How to archive one of the following for failed backup jobs:
a) mark auto-created volume as "Used", OR
b) delete the auto-created volume


Best regards,
Alex

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Types of backup clarifications needed

2012-05-08 Thread Alex Lucas
Could you please provide a link to the most up to date page/doc about
VirtualFull (including setup instructions).

RE the "Since" type of backup -- if not implemented it should be hidden,
no? :)

A related question:
We have a large mail server to backup and full backup is too long hence
there is a need for "reverse-incremental" backup: full backup runs only
once and next backups are merged into the full backup (sounds like
Virtual so far) but we would like to remove old increments (lets say
retention is 60 days) without removing the original full. How can this
be done with Bacula?
The problem with VirtualFull is that it cannot be used as a base for
next incremental (unless I am wrong?)

Regards,
Alex

On 09/05/12 01:51, Martin Simmons wrote:
>>>>>> On Tue, 08 May 2012 11:47:27 +0800, Alex Lucas said:
>> Greetings,
>>
>> I have been searching bacula documentation and there seem to be some
>> incomplete info about types (levels) of backup.
>>
>> When I run a job I get a list of the following level choices:
>>
>> Levels:
>>  1: Full
>>  2: Incremental
>>  3: Differential
>>  4: Since
>>  5: VirtualFull
>>
>> I could not find any documentation about the "Since" level; and info
>> about "VirtualFull" was in a "What's New article" instead of main docs.
>>
>> Maybe I am looking in wrong places -- is there a complete doc describing
>> all 5 levels + instructions on settings and usage?
> The "Since" level is not actually implemented.
>
> It looks like the VirtualFull doc was never merged into the main chapter.
>
> __Martin
>
> --
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Types of backup clarifications needed

2012-05-07 Thread Alex Lucas
Greetings,

I have been searching bacula documentation and there seem to be some
incomplete info about types (levels) of backup.

When I run a job I get a list of the following level choices:

Levels:
 1: Full
 2: Incremental
 3: Differential
 4: Since
 5: VirtualFull

I could not find any documentation about the "Since" level; and info
about "VirtualFull" was in a "What's New article" instead of main docs.

Maybe I am looking in wrong places -- is there a complete doc describing
all 5 levels + instructions on settings and usage?

Best regards,
Alex
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users