Re: [Bacula-users] Backup in disk AND tape

2024-04-10 Thread Chris Wilkinson
I have this working now. The script is below, as per Bill's script with an
extention. It is called from a Runscript as "Command =
/full-path/run-copy-job.sh copy-job-name". There is a copy job defined for
each backup job. The $1 parameter passes the copy job name to the script.

#!/bin/bash
#usage run-copy-job.sh job-name
# Pipe the run command to bconsole
# 
echo "run yes job=$1" | bconsole

This all works fine. The disadvantage is that the copy job hard codes the
level to be copied so the same copy job (in my case full) runs irrespective
of the job being incr/diff/full. For "selection type=PoolUncopiedJobs" this
is only a minor issue since already copied jobs are skipped.

Chris

On Tue, 9 Apr 2024, 15:12 Bill Arlofski,  wrote:

> On 4/9/24 6:53 AM, Chris Wilkinson wrote:
> > Regarding the suggestion to put a Runafter block in the job to run the
> copy job at the end, that doesn't seem to be allowed.
> > Run job=xx commands are not permitted in a Runscript as I just found
> out. It gives a not allowed command error.
> >
> > Perhaps there is another way to accomplish this?
> >
>
> Hello Chris,
>
> Yes, convert that run command to a simple script like:
>
> /opt/bacula/script/run_catalog-copy.sh:
> 8<
> #!/bin/bash
>
> # Pipe the run command to bconsole
> # 
> echo "run yes job=catalog-copy" | bconsole
> 8<
>
> Now, that is the most basic it needs to be, but you can add other things
> to it. ie: error checking, command line options,
> etc. Although in your use case it does not seem necessary to complicate
> things. :)
>
>
> Then, just replace the
> 8<
> Console = "run job=catalog-copy yes"
> 8<
>
> ...line in your RunScript with:
>
> 8<
> `Command = /opt/bacula/script/ru
> n_catalog-copy.sh`
> 8<
>
> And you should be OK.
>
> Make sure your `catalog-copy` job has the same Priority (11) as your
> Catalog job, otherwise you will end up in a dead-lock
> where the Copy job waits for the Catalog job to finish, and the Copy job
> is waiting for the catalog-copy job (which will
> never start) to finish.
>
>
> Hope this helps,
> Bill
>
> --
> Bill Arlofski
> w...@protonmail.com
>
>
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Backup in disk AND tape

2024-04-09 Thread Bill Arlofski via Bacula-users

On 4/9/24 6:53 AM, Chris Wilkinson wrote:
Regarding the suggestion to put a Runafter block in the job to run the copy job at the end, that doesn't seem to be allowed. 
Run job=xx commands are not permitted in a Runscript as I just found out. It gives a not allowed command error.


Perhaps there is another way to accomplish this?



Hello Chris,

Yes, convert that run command to a simple script like:

/opt/bacula/script/run_catalog-copy.sh:
8<
#!/bin/bash

# Pipe the run command to bconsole
# 
echo "run yes job=catalog-copy" | bconsole
8<

Now, that is the most basic it needs to be, but you can add other things to it. ie: error checking, command line options, 
etc. Although in your use case it does not seem necessary to complicate things. :)



Then, just replace the
8<
Console = "run job=catalog-copy yes"
8<

...line in your RunScript with:

8<
`Command = /opt/bacula/script/ru
n_catalog-copy.sh`
8<

And you should be OK.

Make sure your `catalog-copy` job has the same Priority (11) as your Catalog job, otherwise you will end up in a dead-lock 
where the Copy job waits for the Catalog job to finish, and the Copy job is waiting for the catalog-copy job (which will 
never start) to finish.



Hope this helps,
Bill

--
Bill Arlofski
w...@protonmail.com



signature.asc
Description: OpenPGP digital signature
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Backup in disk AND tape

2024-04-09 Thread Chris Wilkinson
Regarding the suggestion to put a Runafter block in the job to run the copy
job at the end, that doesn't seem to be allowed. Run job=xx commands are
not permitted in a Runscript as I just found out. It gives a not allowed
command error.

Perhaps there is another way to accomplish this?

-Chris-

On Wed, 3 Apr 2024, 00:00 Bill Arlofski via Bacula-users, <
bacula-users@lists.sourceforge.net> wrote:

> On 4/2/24 12:01 PM, Roberto Greiner wrote:
> > Hi,
> >
> > I've installed Bacula recently in a server with a 7TB RAID5 storage, and
> > a LTO-6 tape unit.
> >
> > I have configured 9 remote servers (most Linux, one Windows) to have the
> > backup made in this server in the disk storage, and I'm finish to
> > understand how to do the tape backup. Now, I have a question about
> > making the backup into both destinations.
> >
> > I have the following setup for JobsDef:
> >
> > JobDefs {
> > Name = "DefaultJob"
> > Type = Backup
> > Level = Incremental
> > Client = bacula2-fd
> > FileSet = "Full Set"
> > Schedule = "WeeklyCycle"
> > Storage = FileAligned
> > Messages = Standard
> > Pool = File
> > SpoolAttributes = yes
> > Priority = 10
> > Write Bootstrap = "/opt/bacula/working/%c.bsr"
> > }
> >
> > Then I added a server to have the backup, let's say (it's a linux,
> > despite the name):
> >
> > Job {
> > Name = "AD"
> > JobDefs = "DefaultJob"
> > Client = ad-fd
> > FileSet = "etc"
> > }
> >
> > This will, obviously go to the dedup-disk storage. The question is, how
> > should I add the tape setup? Is there a way to add a couple of lines to
> > the job definition above so that the backup goes to both systems? Should
> > I create a separate job definition for the tape backup? Some other way I
> > didn't consider?
> >
> > Thanks,
> >
> > Roberto
> >
> >
> > PS: The storage definitions for the disk and tape destinations:
> >
> > Storage {
> > Name = FileAligned
> > Address = bacula2
> > SDPort = 9103
> > Password = ""
> > Device = Aligned-Disk
> > Media Type = File1
> > }
> >
> > Storage {
> > Name = Fita
> > Address = bacula2
> > SDPort = 9103
> > Password = ""
> > Device = Ultrium
> > Media Type = LTO
> > }
>
> Hello Marcos,
>
> With Bacula, there are almost always 10+ different ways to accomplish
> things, and/or to even think about them.
>
> For example, you can override the Pool, Level, and Storage in a Schedule...
>
> So, with this in mind, you might set your job to run Incs each weekday to
> disk, and then set the Fulls to run to tape on the
> weekend. (just one idea)
>
> Another option is to use Copy jobs. With Copy jobs, you can run your Incs
> and Fulls to disk, then you can run a Copy job to
> copy your Incs, Fulls, or both to tape during normal working hours because
> Copy jobs do not make use of any Clients, so
> business productivity will not be affected on your server(s).
>
> In your case, I would probably go with a Copy job. This way, you have your
> backups on disk for fast restores when needed, and
> you have the same data copied to new jobids onto tape - maybe with longer
> retention periods, for example.
>
> Also have a look at the `SelectionType = PoolUncopiedJobs` feature for
> Copy jobs. This is a nice, handy "shortcut" to make
> sure that each of your jobs in some Pool is copied once, and only once to
> tape.
>
> In this case, you can have two Copy jobs configured, one looking at your
> Full disk pool and one looking at your Inc disk pool
> and copying jobs that have not been copied.
>
> OR, you can have one copy job running on a schedule where the Pool is
> overridden at two different times of the day to copy
> from the Full disk pool, and then also from the Inc disk pool.
>
> OR... (lol I said 10, so I am working towards that number, and I am
> getting close :) ... You can have your normal backup jobs
> include a `RunScript {RunsWhen = after}` section which triggers an
> immediate copy of the job to tape as soon as it is completed.
>
> So, I would start with a look at Copy jobs and see where that goes. :)
>
> Feel free to ask more questions once you have taken a look at Copy jobs.
>
>
> Hope this helps,
> Bill
>
> --
> Bill Arlofski
> w...@protonmail.com
>
> ___
> Bacula-users mailing list
> Bacula-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bacula-users
>
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Backup in disk AND tape

2024-04-03 Thread Roberto Greiner

Em 02/04/2024 19:58, Bill Arlofski via Bacula-users escreveu:

On 4/2/24 12:01 PM, Roberto Greiner wrote:

Hi,

I've installed Bacula recently in a server with a 7TB RAID5 storage, and
a LTO-6 tape unit.

I have configured 9 remote servers (most Linux, one Windows) to have the
backup made in this server in the disk storage, and I'm finish to
understand how to do the tape backup. Now, I have a question about
making the backup into both destinations.

I have the following setup for JobsDef:

JobDefs {
    Name = "DefaultJob"
    Type = Backup
    Level = Incremental
    Client = bacula2-fd
    FileSet = "Full Set"
    Schedule = "WeeklyCycle"
    Storage = FileAligned
    Messages = Standard
    Pool = File
    SpoolAttributes = yes
    Priority = 10
    Write Bootstrap = "/opt/bacula/working/%c.bsr"
}

Then I added a server to have the backup, let's say (it's a linux,
despite the name):

Job {
    Name = "AD"
    JobDefs = "DefaultJob"
    Client = ad-fd
    FileSet = "etc"
}

This will, obviously go to the dedup-disk storage. The question is, how
should I add the tape setup? Is there a way to add a couple of lines to
the job definition above so that the backup goes to both systems? Should
I create a separate job definition for the tape backup? Some other way I
didn't consider?

Thanks,

Roberto


PS: The storage definitions for the disk and tape destinations:

Storage {
    Name = FileAligned
    Address = bacula2
    SDPort = 9103
    Password = ""
    Device = Aligned-Disk
    Media Type = File1
}

Storage {
    Name = Fita
    Address = bacula2
    SDPort = 9103
    Password = ""
    Device = Ultrium
    Media Type = LTO
}


Hello Marcos,

With Bacula, there are almost always 10+ different ways to accomplish 
things, and/or to even think about them.


For example, you can override the Pool, Level, and Storage in a 
Schedule...


So, with this in mind, you might set your job to run Incs each weekday 
to disk, and then set the Fulls to run to tape on the weekend. (just 
one idea)


Another option is to use Copy jobs. With Copy jobs, you can run your 
Incs and Fulls to disk, then you can run a Copy job to copy your Incs, 
Fulls, or both to tape during normal working hours because Copy jobs 
do not make use of any Clients, so business productivity will not be 
affected on your server(s).


In your case, I would probably go with a Copy job. This way, you have 
your backups on disk for fast restores when needed, and you have the 
same data copied to new jobids onto tape - maybe with longer retention 
periods, for example.


Also have a look at the `SelectionType = PoolUncopiedJobs` feature for 
Copy jobs. This is a nice, handy "shortcut" to make sure that each of 
your jobs in some Pool is copied once, and only once to tape.


In this case, you can have two Copy jobs configured, one looking at 
your Full disk pool and one looking at your Inc disk pool and copying 
jobs that have not been copied.


OR, you can have one copy job running on a schedule where the Pool is 
overridden at two different times of the day to copy from the Full 
disk pool, and then also from the Inc disk pool.


OR... (lol I said 10, so I am working towards that number, and I am 
getting close :) ... You can have your normal backup jobs include a 
`RunScript {RunsWhen = after}` section which triggers an immediate 
copy of the job to tape as soon as it is completed.


So, I would start with a look at Copy jobs and see where that goes. :)

Feel free to ask more questions once you have taken a look at Copy jobs.


Hope this helps,
Bill


Yes, this helps A LOT. I will study the copy job option. It really seems 
perfect for my scenario.


Tks

Roberto


--
-
Marcos Roberto Greiner

   Os otimistas acham que estamos no melhor dos mundos
Os pessimistas tem medo de que isto seja verdade
 James Branch Cabell
  -



___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Backup in disk AND tape

2024-04-02 Thread Bill Arlofski via Bacula-users

On 4/2/24 12:01 PM, Roberto Greiner wrote:

Hi,

I've installed Bacula recently in a server with a 7TB RAID5 storage, and
a LTO-6 tape unit.

I have configured 9 remote servers (most Linux, one Windows) to have the
backup made in this server in the disk storage, and I'm finish to
understand how to do the tape backup. Now, I have a question about
making the backup into both destinations.

I have the following setup for JobsDef:

JobDefs {
    Name = "DefaultJob"
    Type = Backup
    Level = Incremental
    Client = bacula2-fd
    FileSet = "Full Set"
    Schedule = "WeeklyCycle"
    Storage = FileAligned
    Messages = Standard
    Pool = File
    SpoolAttributes = yes
    Priority = 10
    Write Bootstrap = "/opt/bacula/working/%c.bsr"
}

Then I added a server to have the backup, let's say (it's a linux,
despite the name):

Job {
    Name = "AD"
    JobDefs = "DefaultJob"
    Client = ad-fd
    FileSet = "etc"
}

This will, obviously go to the dedup-disk storage. The question is, how
should I add the tape setup? Is there a way to add a couple of lines to
the job definition above so that the backup goes to both systems? Should
I create a separate job definition for the tape backup? Some other way I
didn't consider?

Thanks,

Roberto


PS: The storage definitions for the disk and tape destinations:

Storage {
    Name = FileAligned
    Address = bacula2
    SDPort = 9103
    Password = ""
    Device = Aligned-Disk
    Media Type = File1
}

Storage {
    Name = Fita
    Address = bacula2
    SDPort = 9103
    Password = ""
    Device = Ultrium
    Media Type = LTO
}


Hello Marcos,

With Bacula, there are almost always 10+ different ways to accomplish things, 
and/or to even think about them.

For example, you can override the Pool, Level, and Storage in a Schedule...

So, with this in mind, you might set your job to run Incs each weekday to disk, and then set the Fulls to run to tape on the 
weekend. (just one idea)


Another option is to use Copy jobs. With Copy jobs, you can run your Incs and Fulls to disk, then you can run a Copy job to 
copy your Incs, Fulls, or both to tape during normal working hours because Copy jobs do not make use of any Clients, so 
business productivity will not be affected on your server(s).


In your case, I would probably go with a Copy job. This way, you have your backups on disk for fast restores when needed, and 
you have the same data copied to new jobids onto tape - maybe with longer retention periods, for example.


Also have a look at the `SelectionType = PoolUncopiedJobs` feature for Copy jobs. This is a nice, handy "shortcut" to make 
sure that each of your jobs in some Pool is copied once, and only once to tape.


In this case, you can have two Copy jobs configured, one looking at your Full disk pool and one looking at your Inc disk pool 
and copying jobs that have not been copied.


OR, you can have one copy job running on a schedule where the Pool is overridden at two different times of the day to copy 
from the Full disk pool, and then also from the Inc disk pool.


OR... (lol I said 10, so I am working towards that number, and I am getting close :) ... You can have your normal backup jobs 
include a `RunScript {RunsWhen = after}` section which triggers an immediate copy of the job to tape as soon as it is completed.


So, I would start with a look at Copy jobs and see where that goes. :)

Feel free to ask more questions once you have taken a look at Copy jobs.


Hope this helps,
Bill

--
Bill Arlofski
w...@protonmail.com



signature.asc
Description: OpenPGP digital signature
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Backup in disk AND tape

2024-04-02 Thread Roberto Greiner

Hi,

I've installed Bacula recently in a server with a 7TB RAID5 storage, and 
a LTO-6 tape unit.


I have configured 9 remote servers (most Linux, one Windows) to have the 
backup made in this server in the disk storage, and I'm finish to 
understand how to do the tape backup. Now, I have a question about 
making the backup into both destinations.


I have the following setup for JobsDef:

JobDefs {
  Name = "DefaultJob"
  Type = Backup
  Level = Incremental
  Client = bacula2-fd
  FileSet = "Full Set"
  Schedule = "WeeklyCycle"
  Storage = FileAligned
  Messages = Standard
  Pool = File
  SpoolAttributes = yes
  Priority = 10
  Write Bootstrap = "/opt/bacula/working/%c.bsr"
}

Then I added a server to have the backup, let's say (it's a linux, 
despite the name):


Job {
  Name = "AD"
  JobDefs = "DefaultJob"
  Client = ad-fd
  FileSet = "etc"
}

This will, obviously go to the dedup-disk storage. The question is, how 
should I add the tape setup? Is there a way to add a couple of lines to 
the job definition above so that the backup goes to both systems? Should 
I create a separate job definition for the tape backup? Some other way I 
didn't consider?


Thanks,

Roberto


PS: The storage definitions for the disk and tape destinations:

Storage {
  Name = FileAligned
  Address = bacula2
  SDPort = 9103
  Password = ""
  Device = Aligned-Disk
  Media Type = File1
}

Storage {
  Name = Fita
  Address = bacula2
  SDPort = 9103
  Password = ""
  Device = Ultrium
  Media Type = LTO
}




--
-
Marcos Roberto Greiner

   Os otimistas acham que estamos no melhor dos mundos
Os pessimistas tem medo de que isto seja verdade
 James Branch Cabell
  -



___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users