Re: [Bacula-users] Issue restoring from multiple tapes

2017-09-29 Thread Phil Stracchino
On 09/29/17 13:54, Phil Stracchino wrote:
> On 09/29/17 02:14, Ralf Brinkmann wrote:
>> Has someone a Mysql query for on an autochanger test to pickup files
>> that crosses tape boundary?
> 
> HThat's a good question.  Let me think about that one for a
> few minutes.

There isn't a practical way to do it in a single query, but you could
probably write a stored procedure to do it.


First we need to find out what Volumes were used for the Job and in
which order:

MySQL localhost> select distinct Media.MediaId, Media.VolumeName from
Media join JobMedia on JobMedia.MediaId = Media.MediaId where
JobMedia.JobId = 15014 order by Media.LastWritten;
+-++
| MediaId | VolumeName |
+-++
|  48 | LTO4-FULL-0013 |
|2426 | LTO4-FULL-0014 |
|  51 | LTO4-FULL-0016 |
+-++
3 rows in set (0.00 sec)


Now we need to know what the first and last file indexes on each of
those volumes was.  We need three separate queries to do this, one for
each volume, because we can't call min() and max() on values
corresponding to multiple keys at once.  If we do that, we'll get a
single pair of results containing the first and last indexes in the
entire job, which isn't what we want.  We need to go one MediaId at a time:

MySQL localhost> select MediaId, min(FirstIndex), max(LastIndex) from
JobMedia where JobId = 15014 and MediaId = 48;
+-+-++
| MediaId | min(FirstIndex) | max(LastIndex) |
+-+-++
|  48 |   1 | 145851 |
+-+-++
1 row in set (0.00 sec)

MySQL localhost> select MediaId, min(FirstIndex), max(LastIndex) from
JobMedia where JobId = 15014 and MediaId = 2426;
+-+-++
| MediaId | min(FirstIndex) | max(LastIndex) |
+-+-++
|2426 |  145851 | 146663 |
+-+-++
1 row in set (0.00 sec)

MySQL localhost> select MediaId, min(FirstIndex), max(LastIndex) from
JobMedia where JobId = 15014 and MediaId = 51;
+-+-++
| MediaId | min(FirstIndex) | max(LastIndex) |
+-+-++
|  51 |  146663 | 150149 |
+-+-++
1 row in set (0.00 sec)


Uh-oh.  Volume 48's last file has the same FileIndex as volume 2426's
first file, and volume 2426's last file has the same FileIndex as volume
51's first file.  Houston, we have a problem.

Let's find out which files these are.  To do that, we'll need to look
them up by their FileIndexes and the JobId:

MySQL localhost> select FileIndex, Path, Name from File join Filename on
File.FilenameId = Filename.FilenameId join Path on File.PathId =
Path.PathId where JobId = 15014 and (FileIndex = 145851 or FileIndex =
146663);
+---++---+
| FileIndex | Path
| Name  |
+---++---+
|145851 | /netstore/scratch/NIN - The Slip - 96-24 High Res/
| 10 Demon Seed.wav |
|146663 | /netstore/video/TV/Criminal Minds/Criminal Minds Season 3/
| Criminal Minds S03E17 In Heat.avi |
+---++---+
2 rows in set (0.31 sec)


And there you go.  Those two files span tape boundaries.


-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Issue restoring from multiple tapes

2017-09-29 Thread Phil Stracchino
On 09/29/17 02:14, Ralf Brinkmann wrote:
> Has someone a Mysql query for on an autochanger test to pickup files
> that crosses tape boundary?

HThat's a good question.  Let me think about that one for a
few minutes.



-- 
  Phil Stracchino
  Babylon Communications
  ph...@caerllewys.net
  p...@co.ordinate.org
  Landline: +1.603.293.8485
  Mobile:   +1.603.998.6958

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] [Non-DoD Source] Re: Configuration for clients define director

2017-09-29 Thread Hicks, Daniel CTR OSD DMEA
My question is about running the configuration on clients prior to a make
and install. In the configuration script there are switches for defining
items such as the director, storage and file daemons passwords but there is
not a switch to define the director name or address for setting them within
Bacula-fd.conf. 

 

You can edit the file bacula-9.0.3/src/filed/bacula-fd.conf.in changing the
variable to a given and that works however, when a new build comes out that
change is needed again.  

 

It would be more streamline if there was either a switch for the
configuration or if bacula-fd.conf.in used a different variable than
hostname.

 

Daniel Hicks | 916-999-2711 | DMEA 

 

From: Dan Langille [mailto:d...@langille.org] 
Sent: Friday, September 29, 2017 5:23 AM
To: Hicks, Daniel CTR OSD DMEA 
Cc: bacula-users 
Subject: [Non-DoD Source] Re: [Bacula-users] Configuration for clients
define director

 

On Sep 26, 2017, at 9:10 AM, Hicks, Daniel CTR OSD DMEA
 >
wrote:

 

Hello

 

I have been going through the configuration settings working on a script to
configure clients. I have not been able to find which switch is used to
define the director by name and address. 

 

Using Bacula 9.0.3 on Centos7 

 

What is your question?

 

In the bacula-fd.conf, you add a Director { } clause.

 

-- 
Dan Langille - BSDCan / PGCon
d...@langille.org  

 

 



smime.p7s
Description: S/MIME cryptographic signature
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Configuration for clients define director

2017-09-29 Thread Dan Langille
> On Sep 26, 2017, at 9:10 AM, Hicks, Daniel CTR OSD DMEA 
>  wrote:
> 
> Hello
> 
> I have been going through the configuration settings working on a script to 
> configure clients. I have not been able to find which switch is used to 
> define the director by name and address.
> 
> Using Bacula 9.0.3 on Centos7

What is your question?

In the bacula-fd.conf, you add a Director { } clause.

--
Dan Langille - BSDCan / PGCon
d...@langille.org





signature.asc
Description: Message signed with OpenPGP
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula daemon message (Error: bsock.c:544)

2017-09-29 Thread Ralf Brinkmann

Am 28.09.2017 um 15:35 schrieb Ralf Brinkmann:

It is caused by using the following line in bash backup start and end
scripts:
   echo release | bconsole
The command allways askes for a slot number - unneccessarily. The bsock
error then is repeated 4 times.


I don't know whether the slotnumber has any meaning in this context at all.

Little hot fix:


.../bacula-9.0.4/src/dird # diff -wi  ua_cmds.c.save ua_cmds.c
1741c1741
if (strcasecmp(command, "disable") == 0 || strcasecmp(command, "enable") == 0 || 
strcasecmp(command, "release") == 0) {


I replaced /sbin/bacula-dir and restarted bacula.

... seems to work for the moment - for us.

--
Ralf Brinkmann


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Baculum with restricted console: auth failure for wrong FileSet

2017-09-29 Thread Charles

I think this is a bug but I may be doing something wrong ... ?

Baculum is the current version:

# cat /etc/apt/sources.list.d/baculum.list
deb http://bacula.org/downloads/baculum/debian jessie main
deb-src http://bacula.org/downloads/baculum/debian jessie main

A restricted console is defined within the Director conf:

# cat /etc/bacula/conf.d/console/Console-charles.conf
Console {
Name = "charles"
Password = "pass"
CommandACL = 
run,show,.client,.jobs,.fileset,.pool,.storage,.jobs,.bvfs_update,.bvfs_lsdirs,.bvfs_lsfiles,.bvfs_versions,.bvfs_get_jobids,.bvfs_restore,restore

CatalogACL = MyCatalog
ClientACL = bllistest.iciti.av:fd
JobACL = bllistest.iciti.av
PoolACL = Default
StorageACL = "HP_1-8_G2_Tape_Autoloader"
FileSetACL = bllistest.iciti.av
WhereACL = *all*
}

A corresponding bconsole is defined:

root@backup2.iciti:~# cat /etc/bacula/bconsole.d/charles.conf
Director {
Name = backup2-dir
Address = localhost
DIRport = 9101
Password = "NOT USED"
}

Console {
Name = "charles"
Password = "pass"
}

A test restore was attempted:

* Opened http://backup2.iciti.av:9095/ and logged on as charles
* Perform restore
* Backup from client: blisstest.iciti.av:fd (only choice in drop-down)
* Backup selection method: Only selected backup (default)
* Backup for restore: [5429] ... (default, latest, successful Full)
* In "Step 3 - select files to restore", drilled down to 
/root/.bash_profile and clicked its "Add"

* In "Step 4 - select destination for restore"
** Restore to client: blisstest.iciti.av:fd (only choice in drop-down)
** Restore to directory: /tmp/restore (default)
* In "Step 5 - options for restore"
** Replace files: do not replace files (default)
** Restore job priority: 10 (default)
* In "Step 6 - Finish"
** Run restore

Baculum displayed a list of jobs not including the restore.

From /etc/baculum/Data-apache/baculum.dbg:

Sep 28 10:23:32 [Debug] [Execute] Command=sudo /usr/sbin/bconsole -c 
/etc/bacula/bconsole.d/charles.conf -D backup2-dir  Array
(
[0] => restore file="?b25429" 
client="bllistest.iciti.av:fd" where="/tmp/restore" replace="never" 
fileset="bllistest.iciti.av" priority="10" yes

[1] => Using Catalog "MyCatalog"
[2] => Bootstrap records written to 
/var/lib/bacula/backup2.iciti.av:dir.restore.4.bsr
[3] => Bootstrap records written to 
/var/lib/bacula/backup2.iciti.av:dir.restore.4.bsr

[4] =>
[5] => The Job will require the following (*=>InChanger):
[6] =>Volume(s) Storage(s) 
  SD Device(s)
[7] => 
===

[8] =>
[9] =>*AS0008L6 
HP_1-8_G2_Tape_Autoloader HP_1-8_G2_Tape_Autoloader

[10] =>
[11] => Volumes marked with "*" are in the Autochanger.
[12] =>
[13] =>
[14] => 1 file selected to be restored.
[15] =>
[16] => Using Catalog "MyCatalog"
[17] => No authorization. FileSet "backup2.iciti.av".
[18] => Job not run.
)

[exitcode] => 0
)

Given that the FileSet was explicitly named as bllistest.iciti.av, why 
did Baculum attempt to access FileSet backup2.iciti.av?


Experimentation (changing the "File set" line) confirmed that FileSet 
backup2.iciti.av had been read from Job Restore:


Job {
Name = "Restore"
JobDefs = "Common"
Type = Restore
Client = "backup2.iciti.av:fd"
File set = "backup2.iciti.av"
Storage = "HP_1-8_G2_Tape_Autoloader"
Where = /tmp/restore
}

Best

Charles

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users