Re: [bareos-users] Re: Waiting for a client

2019-11-12 Thread Javier Back



On 11/12/19 12:42 AM, Spadajspadaj wrote:

On 12.11.2019 09:11, Jörg Steffens wrote:

On 12.11.19 at 07:59 wrote Spadajspadaj:

Hi there.

I added a laptop client to my bareos setup and everything runs mostly
fine except for the fact that if the job is scheduled for - let's say -
9pm, it tries to run, tries to connect to fd and since the laptop is
down, the job fails.

I was wondering how I can avoid those failed jobs and possibly have
bareos server wait for a client to appear.

I pondered two options:

1) Have completely manual "schedule", so the job never runs on its own.
I need to manually run the job every time I have a laptop available in
my network. But I'm not sure I can specify a schedule which never runs
on its own. Is it even possible? Or

2) Have bareos server wait for the fd to appear on the network. Now
that's trickier. I thought about writing a script and running it as a
pre-job script effectively delaying start of the job itself until I can
reach the fd but:

a) I'm not sure if the pre-job script is run before the initial
connection to fd or after. (haven't tried it yet; just thought about it
today driving to work :-)) and

b) If I understand correctly, such job with a pre-job script would
effectively block other jobs from running in the same time, right?
So if
I have a schedule for all jobs to start at 9pm, then other jobs (for
now
let's not complicate matters with priorities) would wait for my script
to time-out with the Max Run Time limit?

Any other ideas?

What I would ideally want to achieve is to have bareos do a backup
of my
laptop when it gets available on the network (when I come back home and
power on the laptop) but of course not more than once a day.

Of course I can (and probably will if there are no other options) do an
external script which probes the network for the laptop and if found
runs the apropriate job but I was wondering if I can do something like
that "from within" bareos.

You can solve this with a combination of
https://docs.bareos.org/TasksAndConcepts/NetworkSetup.html#client-initiated-connection

and the external script
https://github.com/bareos/bareos-contrib/blob/master/misc/triggerjob/triggerjob.py

run by cron.

Triggerjob will look for all clients connected to the Director.
If is finds a job named backup-{clientname} that did not successfully
run during the specified time period, it will trigger this job.

The upcoming Bareos 19.2.4 will also add an additional feature to the
Bareos core.


Thanks for suggestions. I'll look into it :-)

MK


I found a solution for my own backups by using the retry approach.   I
placed these directives in my jobdefs for the jobs that might fail
because the VM's (clients) are down:

  RerunFailedLevels = yes
  RescheduleOnError = yes
  RescheduleInterval = 6 hours
  RescheduleTimes = 3
  AllowDuplicateJobs = no
  CancelQueuedDuplicates = yes

The last 2 directives may not be necessary, but it helps prevent bogging
down bareos.  So what this does is re-try error'd jobs 3 times:  Once
after 6 hours, then 12 hours, and then 18 hours after the original
attempt failed.   By the time the 4th re-try would re-occur, we are
already into the next day, so it would be pointless to retry it a 4th time.

You might read about these in the docs to fully understand them. BTW,
I've been using this "recipe" for about 3 years now without problems. 
I'm running bareos 16.2 director and storage daemons, with varying
bareos-fd clients.

Good luck.

--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/d6aba5db-dbaf-b1ed-ceaa-85b9854c51bb%40mail.com.


[bareos-users] Copy Error

2019-11-12 Thread Nikolay
I don’t even know what to do ...
In bakulа this configuration worked fine


*Bareos: Copy Error of name-fd Unknown Job Level*

1173257: Copying using JobId=1173212 Job=name.2019-11-12_10.39.19_05
1173257: Bootstrap records written to /mnt/md1/working//dir-name.restore.13.bsr
1173257: Start Copying JobId 1173257, Job=name-copy.2019-11-12_14.02.52_07
1173257: Connected Storage daemon at hostname:9103, encryption: 
PSK-AES256-CBC-SHA
1173257: Using Device "Device-name" to read.
1173258: Connected Storage daemon at hostname.off:9105, encryption: 
PSK-AES256-CBC-SHA
1173258: Using Device "LTO6-Drive-5" to write.
1173257: Error: Bareos dir-name 18.2.5 (30Jan19):
  Build OS:   Linux-4.4.92-6.18-default redhat CentOS release 6.10 
(Final)
  Prev Backup JobId:  1173212
  Prev Backup Job:name.2019-11-12_10.39.19_05
  New Backup JobId:   1173258
  Current JobId:  1173257
  Current Job:name-copy.2019-11-12_14.02.52_07
  Backup Level:   
  Client: name-fd
  FileSet:"name"
  Read Pool:  "name" (From Job resource)
  Read Storage:   "name" (From Pool resource)
  Write Pool: "pool-lto6-cpp-1" (From Job Pool's NextPool resource)
  Write Storage:  "Storage-oracle-LTO-5" (From Storage from Pool's 
NextPool resource)
  Next Pool:  "pool-lto6-cpp-1" (From Job Pool's NextPool resource)
  Catalog:"MyCatalog" (From Default catalog)
  Start time: 12-Nov-2019 14:02:56
  End time:   12-Nov-2019 14:02:56
  Elapsed time:   0 secs
  Priority:   10
  SD Files Written:   0
  SD Bytes Written:   0 (0 B)
  Rate:   0.0 KB/s
  Volume name(s): 
  Volume Session Id:  9
  Volume Session Time:1573547009
  Last Volume Bytes:  0 (0 B)
  SD Errors:  0
  SD termination status:  
  Bareos binary info: bareos.org build: Get official binaries and vendor 
support on bareos.com
  Termination:*** Copying Error ***


Job {
  Name = "name"
  Enabled = no

  Type = Backup

  Messages = "Standard"

  Schedule = "disabled_sched"

  Pool = "name"
  Client = "name-fd"
  FileSet = "name"
  RerunFailedLevels = yes
  Description = ""
}


Storage {
  Name = "name"
  Address = "address"
  Password = "[md5]pass_hash"
  Device = "Device-name"
  MediaType = "File-name"
}


Storage {
  Name = "Storage-oracle-LTO-5"
  Address = "address"
  Port = 9105
  Password = "[md5]pass_hash"
  Device = "SL150-KC22-Drive-5"
  MediaType = "LTO-6"
  AutoChanger = yes
  HeartbeatInterval = 2 minutes 
  MaximumConcurrentJobs = 3
}


Pool {
  Name = "name"
  PoolType = Backup
  LabelType = "bareos"
  MaximumVolumeJobs = 1
  MaximumVolumeBytes = 476 g 857 m 256 k 
  NextPool = "pool-lto6-cpp-1"
  Storage = "name"
  AutoPrune = no
  Recycle = no
}


Pool {
  Name = "pool-lto6-cpp-1"
  PoolType = Backup
  LabelType = "bareos"
  VolumeRetention = 73 years 
  Storage = "Storage-oracle-LTO-5"
  AutoPrune = no
  Recycle = no
  RecyclePool = "pool-lto6-cpp-1"
}


Job {
  Name = "name-copy"
  Type = Copy
  Messages = "Standard"
  Pool = "name"
  SelectionType = PoolUncopiedJobs
}



-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/fa6871e2-2de9-4b5d-a040-cf6a6b814225%40googlegroups.com.


[bareos-users] Bareos: Copy Error of name-fd Unknown Job Level

2019-11-12 Thread Nikolay
I constantly get an error when copying a task to tape ...
Bareos: Copy Error of name-fd Unknown Job Level

I don’t understand what the problem is ...



Job {
  Name = "name"
  Description = ""
  Pool = "name"
  Client = "name-fd"
  FileSet = "name-kg"
  JobDefs = "DefaultJob"
  RerunFailedLevels = yes
}

Pool {
  Name = "name-kg"
  PoolType = Backup
  LabelType = "bareos"
  MaximumVolumeJobs = 1
  Maximum Volume Bytes = 512000MB
  NextPool = "pool-lto6-cpp-1"
  Storage = "name"
  AutoPrune = no
  Recycle = no
}

Job {
  Name = "name-copy"
  Type = Copy
  Level = Full
  Messages = "Standard"
  Pool = "name"
  Client = "name-fd"
  FileSet = "name"
  Schedule = "disabled_sched"
  Enabled = no
  SelectionType = PoolUncopiedJobs
}

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/59c4a2f0-0c49-4409-96c8-75e7ba0923a3%40googlegroups.com.


Re: [bareos-users] Re: Waiting for a client

2019-11-12 Thread Spadajspadaj

On 12.11.2019 09:11, Jörg Steffens wrote:

On 12.11.19 at 07:59 wrote Spadajspadaj:

Hi there.

I added a laptop client to my bareos setup and everything runs mostly
fine except for the fact that if the job is scheduled for - let's say -
9pm, it tries to run, tries to connect to fd and since the laptop is
down, the job fails.

I was wondering how I can avoid those failed jobs and possibly have
bareos server wait for a client to appear.

I pondered two options:

1) Have completely manual "schedule", so the job never runs on its own.
I need to manually run the job every time I have a laptop available in
my network. But I'm not sure I can specify a schedule which never runs
on its own. Is it even possible? Or

2) Have bareos server wait for the fd to appear on the network. Now
that's trickier. I thought about writing a script and running it as a
pre-job script effectively delaying start of the job itself until I can
reach the fd but:

a) I'm not sure if the pre-job script is run before the initial
connection to fd or after. (haven't tried it yet; just thought about it
today driving to work :-)) and

b) If I understand correctly, such job with a pre-job script would
effectively block other jobs from running in the same time, right? So if
I have a schedule for all jobs to start at 9pm, then other jobs (for now
let's not complicate matters with priorities) would wait for my script
to time-out with the Max Run Time limit?

Any other ideas?

What I would ideally want to achieve is to have bareos do a backup of my
laptop when it gets available on the network (when I come back home and
power on the laptop) but of course not more than once a day.

Of course I can (and probably will if there are no other options) do an
external script which probes the network for the laptop and if found
runs the apropriate job but I was wondering if I can do something like
that "from within" bareos.

You can solve this with a combination of
https://docs.bareos.org/TasksAndConcepts/NetworkSetup.html#client-initiated-connection
and the external script
https://github.com/bareos/bareos-contrib/blob/master/misc/triggerjob/triggerjob.py
run by cron.

Triggerjob will look for all clients connected to the Director.
If is finds a job named backup-{clientname} that did not successfully
run during the specified time period, it will trigger this job.

The upcoming Bareos 19.2.4 will also add an additional feature to the
Bareos core.


Thanks for suggestions. I'll look into it :-)

MK


--
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/c35f71cb-9173-808f-93e9-552da91dbcb9%40gmail.com.


[bareos-users] Re: Waiting for a client

2019-11-12 Thread Jörg Steffens
On 12.11.19 at 07:59 wrote Spadajspadaj:
> Hi there.
> 
> I added a laptop client to my bareos setup and everything runs mostly
> fine except for the fact that if the job is scheduled for - let's say -
> 9pm, it tries to run, tries to connect to fd and since the laptop is
> down, the job fails.
> 
> I was wondering how I can avoid those failed jobs and possibly have
> bareos server wait for a client to appear.
> 
> I pondered two options:
> 
> 1) Have completely manual "schedule", so the job never runs on its own.
> I need to manually run the job every time I have a laptop available in
> my network. But I'm not sure I can specify a schedule which never runs
> on its own. Is it even possible? Or
> 
> 2) Have bareos server wait for the fd to appear on the network. Now
> that's trickier. I thought about writing a script and running it as a
> pre-job script effectively delaying start of the job itself until I can
> reach the fd but:
> 
> a) I'm not sure if the pre-job script is run before the initial
> connection to fd or after. (haven't tried it yet; just thought about it
> today driving to work :-)) and
> 
> b) If I understand correctly, such job with a pre-job script would
> effectively block other jobs from running in the same time, right? So if
> I have a schedule for all jobs to start at 9pm, then other jobs (for now
> let's not complicate matters with priorities) would wait for my script
> to time-out with the Max Run Time limit?
> 
> Any other ideas?
> 
> What I would ideally want to achieve is to have bareos do a backup of my
> laptop when it gets available on the network (when I come back home and
> power on the laptop) but of course not more than once a day.
> 
> Of course I can (and probably will if there are no other options) do an
> external script which probes the network for the laptop and if found
> runs the apropriate job but I was wondering if I can do something like
> that "from within" bareos.

You can solve this with a combination of
https://docs.bareos.org/TasksAndConcepts/NetworkSetup.html#client-initiated-connection
and the external script
https://github.com/bareos/bareos-contrib/blob/master/misc/triggerjob/triggerjob.py
run by cron.

Triggerjob will look for all clients connected to the Director.
If is finds a job named backup-{clientname} that did not successfully
run during the specified time period, it will trigger this job.

The upcoming Bareos 19.2.4 will also add an additional feature to the
Bareos core.

Regards,
Jörg


-- 
 Jörg Steffens   joerg.steff...@bareos.com
 Bareos GmbH & Co. KGPhone: +49 221 630693-91
 http://www.bareos.com   Fax:   +49 221 630693-10

 Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
 Komplementär: Bareos Verwaltungs-GmbH
 Geschäftsführer:
 S. Dühr, M. Außendorf, Jörg Steffens, P. Storz

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/qqdpf6%243thv%241%40blaine.gmane.org.