[Bacula-users] Wildfile

2024-04-09 Thread Stefan G. Weichinger



Is this Fileset correct?

Fileset {
  Name = "VM_xxx-y"
  Include {
Options {
  WildFile = "\"/mnt/backup/vmbackup/Backup xxx-y/*.vbk\""
}
  }
}


I don't get files with this ... seems not to match.



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


Re: [Bacula-users] [Bacularis/Baculum] Restore with web doesn't create job before 1 hour

2024-04-09 Thread Marcin Haba
Hello Timothé,

I did some tests and analysis for this hanging restore command error. It
looks that the Bacula Bvfs restore part responsible for hardlinks causes
it. This change came to Bacula in version 11.0.

Looking at this hardlinks part, as a workaround I created an index in the
catalog that solved this hanging:

CREATE INDEX file_jobid_fileindex_idx ON File (JobId, FileIndex);

Creating this index can take some time specially if you have many files in
the File table, but later the restore starts without waiting.

Creating index is not a solution, better if the hardlinks part could be
optimized if possible. For now I don't have any other option for that.

For these hardlinks, in Bacula it is a common part for MySQL/MariaDB and
PostgreSQL, but with MySQL this problem is much better visible.

Best regards,
Marcin Haba (gani)

On Sat, 6 Apr 2024 at 18:55, Marcin Haba  wrote:

> Hello Timothé,
>
> Thanks for providing all details about this restore problem.
>
> I did tests on a set of 150K files with old Bacula 9.0.6 and the latest
> 15.0.2. It looks that something has changed in Bacula MySQL/MariaDB support
> in a version between because on the version 9 it works well, while on 15 it
> hangs on the restore commands.
>
> Your restore using bconsole can work much better because it does not use
> Bacula Bvfs interface.
>
> I will try to look at it deeper in the next few days. I will let know if I
> find something.
>
> Best regards,
> Marcin Haba (gani)
>
> On Thu, 4 Apr 2024 at 16:14, timothe pennec  wrote:
>
>> Hi,
>>
>> I'm using mariadb for database and it's him seems to be slow :
>> top result :
>>
>> top - 16:08:51 up 2 days, 20:10,  6 users,  load average: 0,97, 0,60, 0,29
>> Tasks: 307 total,   1 running, 306 sleeping,   0 stopped,   0 zombie
>> %Cpu(s): 12,5 us,  0,0 sy,  0,0 ni, 87,3 id,  0,0 wa,  0,0 hi,  0,2 si,
>>  0,0 st
>> MiB Mem :   7936,5 total,177,7 free,592,8 used,   7166,1
>> buff/cache
>> MiB Swap:   4096,0 total,   4095,0 free,  1,0 used.   7026,5 avail Mem
>> PID USER  PR  NIVIRTRESSHR S  %CPU  %MEM TIME+ COMMAND
>>   29267 mysql 20   0 1346196 142604  23396 S 100,0   1,8   2:53.58
>> mariadbd
>>
>> I've 8 vCPU but only one is at 100 % (can see it with htop) all other at
>> 0.
>>
>> I've enabled debug level 500 and i can see many log right after submit
>> button "Run" and stuck at :
>>
>> bacula-dir: ua_restore.c:2015-0 JobId=4792 JobIds= FileIndex=10
>> [All 53000 files ...]
>> bacula-dir: ua_restore.c:2015-0 JobId=4792 JobIds= FileIndex=53895
>> bacula-dir: ua_restore.c:2015-0 JobId=4792 JobIds= FileIndex=53896
>> bacula-dir: mysql.c:584-0 db_sql_query finished
>> bacula-dir: ua_restore.c:1476-0 query=SELECT Path.Path, File.Filename
>> FROM File JOIN Path USING (PathId) JOIN b210091 AS T ON (File.JobId =
>> T.JobId AND File.FileIndex = T.FileIndex) WHERE File.Filename LIKE
>> ':component_info_%' AND File.JobId IN (4792)
>> bacula-dir: mysql.c:527-0 db_sql_query starts with SELECT Path.Path,
>> File.Filename FROM File JOIN Path USING (PathId) JOIN b210091 AS T ON
>> (File.JobId = T.JobId AND File.FileIndex = T.FileIndex) WHERE File.Filename
>> LIKE ':component_info_%' AND File.JobId IN (4792)
>>
>>
>> Any idea ?
>>
>> Thank you
>> Timothé
>>
>> --
>> *De :* Marcin Haba 
>> *Envoyé :* mercredi 3 avril 2024 21:53
>> *À :* timothe pennec 
>> *Cc :* bacula-users@lists.sourceforge.net <
>> bacula-users@lists.sourceforge.net>
>> *Objet :* Re: [Bacula-users] [Bacularis/Baculum] Restore with web
>> doesn't create job before 1 hour
>>
>> Hello Timothé,
>>
>> Thanks for your detailed description of the problem.
>>
>> For start I would propose to check what is going inside Bacula and the
>> Catalog when this restore is trying to start.
>>
>> Yes, observing 'ps aux' is a good idea, that you did. Also useful can be
>> 'top' command with watching what process takes the most resources.
>>
>> From the Bacula side you can set debug for Director by this bconsole
>> command:
>>
>> setdebug level=500 tags=bvfs,sql trace=1 dir
>>
>> in the Bacula Director working directory you will see the
>> youdirector-dir.trace file where this debug lines will be written.
>>
>> If your Catalog database is PostgreSQL you ran run in the time of the
>> restore hanging this SQL query to see currently pending SQL queries:
>>
>> SELECT * FROM pg_stat_activity;
>>
>> Please let us know about the results.
>>
>> Good luck.
>>
>> Best regards,
>> Marcin Haba (gani)
>>
>> On Wed, 3 Apr 2024 at 20:40, timothe pennec  wrote:
>>
>> Hi everyone,
>>
>> I've one issue with Bacularis (and same with Baculum) WEB when i follow
>> the restore wizzard :
>>
>>- I select my client and let checked "Enable restore from copy job
>>feature"
>>- I select the Last full Backup of my client
>>- I select one folder with add button (total of files about 55 000
>>and total syse about 4Go)
>>- I select the same client and "/tm/restore" folder for testing
>>- I le

Re: [Bacula-users] Install.sh error trying to install manually Bacularis

2024-04-09 Thread Marcin Haba
Hello Neil,

For running everything in FreeBSD Jail, if to use mtx-changer by bacula
user is needed sudo, I think the sudo needs to be added to ChangerCommand
too:

Autochanger {
  Name = "TL2000"
  Device = "HH-LTO7"
  ChangerDevice = "/dev/pass1"
  ChangerCommand = "sudo /etc/bacula/scripts/mtx-changer %c %o %S %a %d"
}

For Perl, it is used by mtx-changer script. I see in mtx-changer that the
Perl command can be changed to commented by default awk/sed/cut commands.
Inside mtx-changer after the Perl command is this comment:

# If perl isn't installed, you can use by those commands

Best regards,
Marcin Haba (gani)

On Wed, 10 Apr 2024 at 01:44, Neil Balchin  wrote:

> So I’m doing all of this from within a Freebsd Jail inside of Trueness.
>
> Therefore although I can expose the /dev devices I can’t easily change
> their rwx properties so instead I added some lines to my sudoers config
> file that allows the www and bacula users to perform certain sudo functions
> without a password.
>
>
> I added a sudo in front of my max-changer config in my bacula-sd.conf,  by
> my theory this should be just fine
>
> I tested this command:
>
> root@Bacula1:~ # sudo -u bacula sudo /usr/local/share/bacula/mtx-changer
> /dev/pass1 slots
>
> 24
>
> root@Bacula1:~ #
>
>
> And as you can see I get the expected count of 24 slots
>
>
> Unfortunately from console:  I get
>
>
> *update slots
>
> Automatically selected Catalog: MyCatalog
>
> Using Catalog "MyCatalog"
>
> The defined Storage resources are:
>
>  1: File1
>
>  2: File2
>
>  3: HH-LTO7
>
>  4: TL2000
>
> Select Storage resource (1-4): 4
>
> Connecting to Storage daemon TL2000 at localhost:9103 ...
>
> 3306 Issuing autochanger "slots" command.
>
> Device "TL2000" has 0 slots.
>
> No slots in changer to scan.
>
> *
>
>
> Now when I try to add the Autochanger TL2000 in the API I get an error
> that it can’t find perl,  Is perl a preqequisite to bacula and I missed
> that ?
>
>
>
>
>
>
> On 9 Apr 2024, at 14:39, Marcin Haba  wrote:
>
> Hello Neil,
>
> From your description it looks that Bacularis works with the mtx-changer
> script well.
>
> For labeling volumes, as it is action realized by Bacula SD, so I think,
> it might be good to check if the mtx-changer script is capable of being
> correctly executed by the bacula user.
>
> For test I would propose to try this command:
>
> # sudo -u bacula /etc/bacula/scripts/mtx-changer /dev/pass1 slots
>
> and also a good test could be trying to label a sample volume using
> bconsole.
>
> Best regards,
> Marcin Haba (gani)
>
> On Tue, 9 Apr 2024 at 20:30, Rob Gerber  wrote:
>
>> What happens when you click 'update slots' on the volumes page, and tell
>> it to update slots 1-24? Idk if this is relevant, but perhaps it is. Should
>> update bacula's knowledge of what is in the library, as per mtx. The output
>> once you click that button and tell it to update slots 1-24 should show
>> that it knew about every tape's position in various slots in the library.
>> If it says anything about updating a record to reflect a tape being in a
>> certain slot, then its knowledge was incorrect and has been corrected.
>>
>> Robert Gerber
>> 402-237-8692
>> r...@craeon.net
>>
>> On Tue, Apr 9, 2024, 1:14 PM Neil Balchin  wrote:
>>
>>> Ok Great,  that solves that problem
>>>
>>> I’m almost there
>>>
>>> I’m using a Dell TL2000 Tape library and a HH LTO7 drive
>>>
>>> I’ve added these to my bacula-sd ( configs pasted below). Also added the
>>> Autochanger and Drives to the API device list
>>>
>>> From the API gui. It’s clearly running the slots and status commands
>>> properly. Because it shows the 19 tapes with barcodes ,  however when I try
>>> to label these tapes from the volumes page it reports Zero slots
>>>
>>> Autochanger {
>>>   Name = "TL2000"
>>>   Device = "HH-LTO7"
>>>   ChangerDevice = "/dev/pass1"
>>>   ChangerCommand = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>>> }
>>>
>>> Device {
>>>   Name = "HH-LTO7"
>>>   MediaType = "LTO-7"
>>>   ArchiveDevice = "/dev/sa0"
>>>   HardwareEndOfMedium = no
>>>   BackwardSpaceRecord = no
>>>   BsfAtEom = yes
>>>   TwoEof = yes
>>>   FastForwardSpaceFile = yes
>>>   RemovableMedia = yes
>>>   RandomAccess = no
>>>   AutomaticMount = yes
>>>   AlwaysOpen = yes
>>>   Autochanger = yes
>>>   ControlDevice = "/dev/pass1"
>>>   AlertCommand = "/usr/local/share/bacula/tapealert %l"
>>> }
>>>
>>> I can run mt and mtx commands freely from the command line as both the
>>> bacula user and www user so I think my /dev/ permissions are ok
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>

-- 

"Greater love hath no man than this, that a man lay down his life for
his friends." Jesus Christ

"Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
za przyjaciół swoich." Jezus Chrystus
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacularis in a container

2024-04-09 Thread Rob Gerber
I know what your problem is. You need a Bacularis API instance. Bacularis
web connects to a Bacularis API instance, which connects to the bacula
director. Right now you only have a Bacularis web instance.

If your bacula instance is entirely bare metal, not in a container, then
you probably don't want to use containers to install Bacularis, or at least
don't want to use containers for the Bacularis API. I recommend installing
Bacularis api + web on bare metal in that case.

There is not a container featuring a Bacularis web instance with a
Bacularis API instance but NO bacula components. I don't know why this is
the case. The various containers that do exist support a number of
different circumstances where Bacularis is being used to manage a
distributed, modular bacula system. There isn't a single container that
only contains the functionality and packages to support Bacularis
management of an existing bare metal bacula instance.


Robert Gerber
402-237-8692
r...@craeon.net

On Tue, Apr 9, 2024, 4:06 PM Thing  wrote:

> Hi,
>
> What am I missing here to connect my bacularis-web container to the
> bacula-director pls?
>
>
> https://imgur.com/a/No8S74f
> ___
> 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


[Bacula-users] Bacularis in a container

2024-04-09 Thread Thing
Hi,

What am I missing here to connect my bacularis-web container to the
bacula-director pls?


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


Re: [Bacula-users] Install.sh error trying to install manually Bacularis

2024-04-09 Thread Rob Gerber
What happens when you click 'update slots' on the volumes page, and tell it
to update slots 1-24? Idk if this is relevant, but perhaps it is. Should
update bacula's knowledge of what is in the library, as per mtx. The output
once you click that button and tell it to update slots 1-24 should show
that it knew about every tape's position in various slots in the library.
If it says anything about updating a record to reflect a tape being in a
certain slot, then its knowledge was incorrect and has been corrected.

Robert Gerber
402-237-8692
r...@craeon.net

On Tue, Apr 9, 2024, 1:14 PM Neil Balchin  wrote:

> Ok Great,  that solves that problem
>
> I’m almost there
>
> I’m using a Dell TL2000 Tape library and a HH LTO7 drive
>
> I’ve added these to my bacula-sd ( configs pasted below). Also added the
> Autochanger and Drives to the API device list
>
> From the API gui. It’s clearly running the slots and status commands
> properly. Because it shows the 19 tapes with barcodes ,  however when I try
> to label these tapes from the volumes page it reports Zero slots
>
> Autochanger {
>
>   Name = "TL2000"
>
>   Device = "HH-LTO7"
>
>   ChangerDevice = "/dev/pass1"
>
>   ChangerCommand = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>
> }
>
>
> Device {
>
>   Name = "HH-LTO7"
>
>   MediaType = "LTO-7"
>
>   ArchiveDevice = "/dev/sa0"
>
>   HardwareEndOfMedium = no
>
>   BackwardSpaceRecord = no
>
>   BsfAtEom = yes
>
>   TwoEof = yes
>
>   FastForwardSpaceFile = yes
>
>   RemovableMedia = yes
>
>   RandomAccess = no
>
>   AutomaticMount = yes
>
>   AlwaysOpen = yes
>
>   Autochanger = yes
>
>   ControlDevice = "/dev/pass1"
>
>   AlertCommand = "/usr/local/share/bacula/tapealert %l"
>
> }
>
>
> I can run mt and mtx commands freely from the command line as both the
> bacula user and www user so I think my /dev/ permissions are ok
>
>
>
>
>
>
> On 9 Apr 2024, at 09:39, Marcin Haba  wrote:
>
> Hello Neil,
>
> Great to hear that you were able to set up the Bacularis instance.
>
> This error that you see is because in the php.ini file on FreeBSD by
> default is error reporting set to display all errors. To fix this error you
> need to edit php.ini file:
>
> /usr/local/etc/php.ini
>
> and change error reporting line from this:
>
> error_reporting = E_ALL
>
> into this one:
>
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
>
> At the end you need to restart PHP.
>
> Best regards,
> Marcin Haba (gani)
>
> On Tue, 9 Apr 2024 at 15:22, Neil Balchin  wrote:
>
>> Thanks so much,
>>
>>
>> I got a little further along my path
>>
>> The Bacularis web guide is up and running
>>
>> I’ve configured my web server user (www) to have appropriate file
>> permissions for the bacula config files and directories and added the sudo
>> permissions for the necessary binaries
>>
>> I think I’m missing something in my server setup because
>>
>> I get this error when I try to config anything:
>>
>>
>>
>> Error 1000 - Internal error. [Unknown Error] substr(): Passing null to
>> parameter #1 ($string) of type string is deprecated (@line 232 in file
>> /usr/local/www/bacularis/protected/vendor/pradosoft/prado/framework/Data/Common/Pgsql/TPgsqlMetaData.php).
>>
>>
>>
>> On 8 Apr 2024, at 23:35, Marcin Haba  wrote:
>>
>> Hello Neil,
>>
>> I have checked installing Bacularis on FreeBSD and I have one more note.
>>
>> By default in Apache is used PHP as Apache module. If you want to use it
>> this way, it is fine. Nothing else to do. If you will need to use PHP
>> through PHP-FPM, then you need to do a few changes in your httpd.conf to
>> disable the Apache PHP module and enable PHP-FPM.
>>
>> First, you need to disable/comment the MPM Prefork module and libphp:
>>
>> #LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
>> #LoadModule php_module libexec/apache24/libphp.so
>>
>> and enable/uncomment these modules:
>>
>> LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
>> LoadModule proxy_module libexec/apache24/mod_proxy.so
>> LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
>>
>> Then you need to add these lines to the same httpd.conf:
>>
>> 
>> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
>> 
>> SetHandler  "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost/"
>> 
>> 
>>
>> At the end in /usr/local/etc/php-fpm.d/www.conf you need to set
>> permissions for PHP-FPM unix socket:
>>
>> listen.owner = www
>> listen.group = www
>> listen.mode = 0660
>>
>> and restart the services:
>>
>> # service php-fpm restart
>> # service apache24 restart
>>
>> Best regards,
>> Marcin Haba (gani)
>>
>> On Tue, 9 Apr 2024 at 04:54, Marcin Haba  wrote:
>>
>>> Hello Neil,
>>>
>>> Thanks for your feedback with installing Bacularis on FreeBSD.
>>>
>>> It looks that in your environment this script uses the default FreeBSD
>>> shell /bin/sh (or any other) that does not support arrays.
>>>
>>> This is the Bash script so to use it you need to install Bash:
>>>
>>> # pkg install 

Re: [Bacula-users] Install.sh error trying to install manually Bacularis

2024-04-09 Thread Marcin Haba
Hello Neil,

>From your description it looks that Bacularis works with the mtx-changer
script well.

For labeling volumes, as it is action realized by Bacula SD, so I think, it
might be good to check if the mtx-changer script is capable of being
correctly executed by the bacula user.

For test I would propose to try this command:

# sudo -u bacula /etc/bacula/scripts/mtx-changer /dev/pass1 slots

and also a good test could be trying to label a sample volume using
bconsole.

Best regards,
Marcin Haba (gani)

On Tue, 9 Apr 2024 at 20:30, Rob Gerber  wrote:

> What happens when you click 'update slots' on the volumes page, and tell
> it to update slots 1-24? Idk if this is relevant, but perhaps it is. Should
> update bacula's knowledge of what is in the library, as per mtx. The output
> once you click that button and tell it to update slots 1-24 should show
> that it knew about every tape's position in various slots in the library.
> If it says anything about updating a record to reflect a tape being in a
> certain slot, then its knowledge was incorrect and has been corrected.
>
> Robert Gerber
> 402-237-8692
> r...@craeon.net
>
> On Tue, Apr 9, 2024, 1:14 PM Neil Balchin  wrote:
>
>> Ok Great,  that solves that problem
>>
>> I’m almost there
>>
>> I’m using a Dell TL2000 Tape library and a HH LTO7 drive
>>
>> I’ve added these to my bacula-sd ( configs pasted below). Also added the
>> Autochanger and Drives to the API device list
>>
>> From the API gui. It’s clearly running the slots and status commands
>> properly. Because it shows the 19 tapes with barcodes ,  however when I try
>> to label these tapes from the volumes page it reports Zero slots
>>
>> Autochanger {
>>
>>   Name = "TL2000"
>>
>>   Device = "HH-LTO7"
>>
>>   ChangerDevice = "/dev/pass1"
>>
>>   ChangerCommand = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
>>
>> }
>>
>>
>> Device {
>>
>>   Name = "HH-LTO7"
>>
>>   MediaType = "LTO-7"
>>
>>   ArchiveDevice = "/dev/sa0"
>>
>>   HardwareEndOfMedium = no
>>
>>   BackwardSpaceRecord = no
>>
>>   BsfAtEom = yes
>>
>>   TwoEof = yes
>>
>>   FastForwardSpaceFile = yes
>>
>>   RemovableMedia = yes
>>
>>   RandomAccess = no
>>
>>   AutomaticMount = yes
>>
>>   AlwaysOpen = yes
>>
>>   Autochanger = yes
>>
>>   ControlDevice = "/dev/pass1"
>>
>>   AlertCommand = "/usr/local/share/bacula/tapealert %l"
>>
>> }
>>
>>
>> I can run mt and mtx commands freely from the command line as both the
>> bacula user and www user so I think my /dev/ permissions are ok
>>
>>
>>
>>
>>
>>
>> On 9 Apr 2024, at 09:39, Marcin Haba  wrote:
>>
>> Hello Neil,
>>
>> Great to hear that you were able to set up the Bacularis instance.
>>
>> This error that you see is because in the php.ini file on FreeBSD by
>> default is error reporting set to display all errors. To fix this error you
>> need to edit php.ini file:
>>
>> /usr/local/etc/php.ini
>>
>> and change error reporting line from this:
>>
>> error_reporting = E_ALL
>>
>> into this one:
>>
>> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
>>
>> At the end you need to restart PHP.
>>
>> Best regards,
>> Marcin Haba (gani)
>>
>> On Tue, 9 Apr 2024 at 15:22, Neil Balchin  wrote:
>>
>>> Thanks so much,
>>>
>>>
>>> I got a little further along my path
>>>
>>> The Bacularis web guide is up and running
>>>
>>> I’ve configured my web server user (www) to have appropriate file
>>> permissions for the bacula config files and directories and added the sudo
>>> permissions for the necessary binaries
>>>
>>> I think I’m missing something in my server setup because
>>>
>>> I get this error when I try to config anything:
>>>
>>>
>>>
>>> Error 1000 - Internal error. [Unknown Error] substr(): Passing null to
>>> parameter #1 ($string) of type string is deprecated (@line 232 in file
>>> /usr/local/www/bacularis/protected/vendor/pradosoft/prado/framework/Data/Common/Pgsql/TPgsqlMetaData.php).
>>>
>>>
>>>
>>> On 8 Apr 2024, at 23:35, Marcin Haba  wrote:
>>>
>>> Hello Neil,
>>>
>>> I have checked installing Bacularis on FreeBSD and I have one more note.
>>>
>>> By default in Apache is used PHP as Apache module. If you want to use it
>>> this way, it is fine. Nothing else to do. If you will need to use PHP
>>> through PHP-FPM, then you need to do a few changes in your httpd.conf to
>>> disable the Apache PHP module and enable PHP-FPM.
>>>
>>> First, you need to disable/comment the MPM Prefork module and libphp:
>>>
>>> #LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
>>> #LoadModule php_module libexec/apache24/libphp.so
>>>
>>> and enable/uncomment these modules:
>>>
>>> LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
>>> LoadModule proxy_module libexec/apache24/mod_proxy.so
>>> LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
>>>
>>> Then you need to add these lines to the same httpd.conf:
>>>
>>> 
>>> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
>>> 
>>> SetHandler  "proxy:unix:/tmp/php-fpm.s

Re: [Bacula-users] Install.sh error trying to install manually Bacularis

2024-04-09 Thread Neil Balchin
Ok Great,  that solves that problem

I’m almost there

I’m using a Dell TL2000 Tape library and a HH LTO7 drive 

I’ve added these to my bacula-sd ( configs pasted below). Also added the 
Autochanger and Drives to the API device list

From the API gui. It’s clearly running the slots and status commands properly. 
Because it shows the 19 tapes with barcodes ,  however when I try to label 
these tapes from the volumes page it reports Zero slots

Autochanger {
  Name = "TL2000"
  Device = "HH-LTO7"
  ChangerDevice = "/dev/pass1"
  ChangerCommand = "/etc/bacula/scripts/mtx-changer %c %o %S %a %d"
}

Device {
  Name = "HH-LTO7"
  MediaType = "LTO-7"
  ArchiveDevice = "/dev/sa0"
  HardwareEndOfMedium = no
  BackwardSpaceRecord = no
  BsfAtEom = yes
  TwoEof = yes
  FastForwardSpaceFile = yes
  RemovableMedia = yes
  RandomAccess = no  
  AutomaticMount = yes
  AlwaysOpen = yes
  Autochanger = yes
  ControlDevice = "/dev/pass1"
  AlertCommand = "/usr/local/share/bacula/tapealert %l"
}

I can run mt and mtx commands freely from the command line as both the bacula 
user and www user so I think my /dev/ permissions are ok





> On 9 Apr 2024, at 09:39, Marcin Haba  wrote:
> 
> Hello Neil,
> 
> Great to hear that you were able to set up the Bacularis instance.
> 
> This error that you see is because in the php.ini file on FreeBSD by default 
> is error reporting set to display all errors. To fix this error you need to 
> edit php.ini file:
> 
> /usr/local/etc/php.ini
> 
> and change error reporting line from this:
> 
> error_reporting = E_ALL
> 
> into this one:
> 
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
> 
> At the end you need to restart PHP.
> 
> Best regards,
> Marcin Haba (gani)
> 
> On Tue, 9 Apr 2024 at 15:22, Neil Balchin  > wrote:
>> Thanks so much,  
>> 
>> 
>> I got a little further along my path
>> 
>> The Bacularis web guide is up and running
>> 
>> I’ve configured my web server user (www) to have appropriate file 
>> permissions for the bacula config files and directories and added the sudo 
>> permissions for the necessary binaries
>> 
>> I think I’m missing something in my server setup because
>> 
>> I get this error when I try to config anything:
>> 
>> 
>> 
>> Error 1000 - Internal error. [Unknown Error] substr(): Passing null to 
>> parameter #1 ($string) of type string is deprecated (@line 232 in file 
>> /usr/local/www/bacularis/protected/vendor/pradosoft/prado/framework/Data/Common/Pgsql/TPgsqlMetaData.php).
>> 
>> 
>> 
>>> On 8 Apr 2024, at 23:35, Marcin Haba >> > wrote:
>>> 
>>> Hello Neil,
>>> 
>>> I have checked installing Bacularis on FreeBSD and I have one more note.
>>> 
>>> By default in Apache is used PHP as Apache module. If you want to use it 
>>> this way, it is fine. Nothing else to do. If you will need to use PHP 
>>> through PHP-FPM, then you need to do a few changes in your httpd.conf to 
>>> disable the Apache PHP module and enable PHP-FPM.
>>> 
>>> First, you need to disable/comment the MPM Prefork module and libphp:
>>> 
>>> #LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
>>> #LoadModule php_module libexec/apache24/libphp.so
>>> 
>>> and enable/uncomment these modules:
>>> 
>>> LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
>>> LoadModule proxy_module libexec/apache24/mod_proxy.so
>>> LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
>>> 
>>> Then you need to add these lines to the same httpd.conf:
>>> 
>>> 
>>> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
>>> 
>>> SetHandler  "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost/"
>>> 
>>> 
>>> 
>>> At the end in /usr/local/etc/php-fpm.d/www.conf you need to set permissions 
>>> for PHP-FPM unix socket:
>>> 
>>> listen.owner = www
>>> listen.group = www
>>> listen.mode = 0660
>>> 
>>> and restart the services:
>>> 
>>> # service php-fpm restart
>>> # service apache24 restart
>>> 
>>> Best regards,
>>> Marcin Haba (gani)
>>> 
>>> On Tue, 9 Apr 2024 at 04:54, Marcin Haba >> > wrote:
 Hello Neil,
 
 Thanks for your feedback with installing Bacularis on FreeBSD.
 
 It looks that in your environment this script uses the default FreeBSD 
 shell /bin/sh (or any other) that does not support arrays.
 
 This is the Bash script so to use it you need to install Bash:
 
 # pkg install bash
 
 After that you need to update shebang in the install.sh script to:
 
 #!/usr/local/bin/bash
 
 Once it is done, it should start working well. In case problems, please 
 let us know.
 
 Good luck!
 
 Best regards,
 Marcin Haba (gani)
 
 On Tue, 9 Apr 2024 at 02:38, Neil Balchin >>> > wrote:
> I’ve installed Bacula in a Freebsd Jail and all is well,  Also installed 
> Apache24, and the requisite php mods to ru

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] Install.sh error trying to install manually Bacularis

2024-04-09 Thread Marcin Haba
Hello Neil,

Great to hear that you were able to set up the Bacularis instance.

This error that you see is because in the php.ini file on FreeBSD by
default is error reporting set to display all errors. To fix this error you
need to edit php.ini file:

/usr/local/etc/php.ini

and change error reporting line from this:

error_reporting = E_ALL

into this one:

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT

At the end you need to restart PHP.

Best regards,
Marcin Haba (gani)

On Tue, 9 Apr 2024 at 15:22, Neil Balchin  wrote:

> Thanks so much,
>
>
> I got a little further along my path
>
> The Bacularis web guide is up and running
>
> I’ve configured my web server user (www) to have appropriate file
> permissions for the bacula config files and directories and added the sudo
> permissions for the necessary binaries
>
> I think I’m missing something in my server setup because
>
> I get this error when I try to config anything:
>
>
>
> Error 1000 - Internal error. [Unknown Error] substr(): Passing null to
> parameter #1 ($string) of type string is deprecated (@line 232 in file
> /usr/local/www/bacularis/protected/vendor/pradosoft/prado/framework/Data/Common/Pgsql/TPgsqlMetaData.php).
>
>
>
> On 8 Apr 2024, at 23:35, Marcin Haba  wrote:
>
> Hello Neil,
>
> I have checked installing Bacularis on FreeBSD and I have one more note.
>
> By default in Apache is used PHP as Apache module. If you want to use it
> this way, it is fine. Nothing else to do. If you will need to use PHP
> through PHP-FPM, then you need to do a few changes in your httpd.conf to
> disable the Apache PHP module and enable PHP-FPM.
>
> First, you need to disable/comment the MPM Prefork module and libphp:
>
> #LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
> #LoadModule php_module libexec/apache24/libphp.so
>
> and enable/uncomment these modules:
>
> LoadModule mpm_event_module libexec/apache24/mod_mpm_event.so
> LoadModule proxy_module libexec/apache24/mod_proxy.so
> LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
>
> Then you need to add these lines to the same httpd.conf:
>
> 
> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
> 
> SetHandler  "proxy:unix:/tmp/php-fpm.sock|fcgi://localhost/"
> 
> 
>
> At the end in /usr/local/etc/php-fpm.d/www.conf you need to set
> permissions for PHP-FPM unix socket:
>
> listen.owner = www
> listen.group = www
> listen.mode = 0660
>
> and restart the services:
>
> # service php-fpm restart
> # service apache24 restart
>
> Best regards,
> Marcin Haba (gani)
>
> On Tue, 9 Apr 2024 at 04:54, Marcin Haba  wrote:
>
>> Hello Neil,
>>
>> Thanks for your feedback with installing Bacularis on FreeBSD.
>>
>> It looks that in your environment this script uses the default FreeBSD
>> shell /bin/sh (or any other) that does not support arrays.
>>
>> This is the Bash script so to use it you need to install Bash:
>>
>> # pkg install bash
>>
>> After that you need to update shebang in the install.sh script to:
>>
>> #!/usr/local/bin/bash
>>
>> Once it is done, it should start working well. In case problems, please
>> let us know.
>>
>> Good luck!
>>
>> Best regards,
>> Marcin Haba (gani)
>>
>> On Tue, 9 Apr 2024 at 02:38, Neil Balchin  wrote:
>>
>>> I’ve installed Bacula in a Freebsd Jail and all is well,  Also installed
>>> Apache24, and the requisite php mods to run bacularis.
>>>
>>> I’ve followed the manual instructions to the letter but when I get to
>>> the install.sh step I get this error output :
>>>
>>> root@Bacula1:/usr/local/www/bacularis/protected/tools # sh ./install.sh
>>> -p /tmp/php-fpm.sock
>>>
>>> +===+
>>> |  Welcome in the Bacularis install script  |
>>> +---+
>>> |  This script will help you to adjust privileges   |
>>> |  for Bacularis files and it will prepare  |
>>> |  configuration files for popular web servers. |
>>> +---+
>>>
>>>
>>> ./install.sh: 34: Syntax error: word unexpected (expecting ")")
>>> root@Bacula1:/usr/local/www/bacularis/protected/tools #
>>>
>>>
>>>
>>> ___
>>> Bacula-users mailing list
>>> Bacula-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>>
>>
>>
>> --
>>
>> "Greater love hath no man than this, that a man lay down his life for his 
>> friends." Jesus Christ
>>
>> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
>> przyjaciół swoich." Jezus Chrystus
>>
>>
>
> --
>
> "Greater love hath no man than this, that a man lay down his life for his 
> friends." Jesus Christ
>
> "Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie za 
> przyjaciół swoich." Jezus Chrystus
>
>
>

-- 

"Greater love hath no man than this, that a man lay down his life for
his friends." Jesus Christ

"Większej miłości nikt 

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] Version of openssl supported (bacula with postgresql)

2024-04-09 Thread Eduardo Rothe via Bacula-users
 Hi Eric
Thank you for your reply !
I got it working, I had misconfigured the repository.In 
/etc/yum.repos.d/bacula.repo  file I had a reference to  el7  in the  baseurl 
variable.I changed   el7  to  el9   and now it works fine.
This was clearly a copy & paste issue, and not paying enough attention from my 
side, but your answer got me thinking: should I beware of using the Bacula 
repository  rpms/15.0.2/el9/x86_64  on another RHEL based distributions like 
Fedora ?
Eduardo



On Monday, 8 April 2024 at 13:59:29 CEST, Eric Bollengier 
 wrote:  
 Hello Eduardo,

I would not try to install Centos7 packages to a Fedora system, it's two
different things. In this case, you can take the Fedora version if it's
recent (it should), or compile it yourself, the recent OpenSSL should be
ok with some warnings about their constant need of breaking their API.

Hope it helps!

Best Regards,
Eric



On 4/8/24 09:57, Eduardo Rothe via Bacula-users wrote:

While installing bacula-postgresql in fedora39 (package downloaded from the 
bacula repositories) I am getting the following messages:

- nothing provides libcrypto.so.10()(64bit) needed by 
bacula-postgresql-15.0.2-24032211.el7.x86_64 from Bacula-Community- nothing 
provides libssl.so.10()(64bit) needed by 
bacula-postgresql-15.0.2-24032211.el7.x86_64 from Bacula-Community

I believe this is because bacula requires an older version of openssl. What is 
the latest version of openssl supported by bacula ? Can I infer openssl-1.0.* ?

A very nice beginning of week to all
Eduardo

bacula 15.0.2
postgresql 15.6
openssl 3.1.1fedora 39


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


Re: [Bacula-users] Error: cannot run a job from a RunScript

2024-04-09 Thread Martin Simmons
> On Tue, 9 Apr 2024 10:57:24 +0100, Chris Wilkinson said:
> 
> I tried to get a copy job to run after completion of the job using a
> Runscript. The Job is shown below. I can run this copy job OK from within
> bconsole/baculum but it fails when run from a Runscript.
> 
> I get an error "09-Apr 09:52 bsvr-dir JobId 0: Can't use run command in a
> runscript09-Apr 09:52 bsvr-dir JobId 0: run: is an invalid command."
> 
> Is it not permissible to use a run command within a Runscript block?

The run command is not allowed.  You can only use the commands documented
under RunScript in the manual.

__Martin


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


[Bacula-users] Error: cannot run a job from a RunScript

2024-04-09 Thread Chris Wilkinson
I tried to get a copy job to run after completion of the job using a
Runscript. The Job is shown below. I can run this copy job OK from within
bconsole/baculum but it fails when run from a Runscript.

I get an error "09-Apr 09:52 bsvr-dir JobId 0: Can't use run command in a
runscript09-Apr 09:52 bsvr-dir JobId 0: run: is an invalid command."

Is it not permissible to use a run command within a Runscript block?

Many thanks
Chris Wilkinson

Job {
  Name = "catalog"
  Description = "Catalog"
  Type = "Backup"
  Level = "Full"
  Messages = "Standard"
  Storage = "dns-325-sd"
  Pool = "catalog"
  FullBackupPool = "catalog"
  Client = "catalog-fd"
  Fileset = "Catalog"
  Schedule = "catalogDaily"
  WriteBootstrap = "/var/lib/bacula/%n.bsr"
  MaxFullInterval = 86400
  PruneJobs = yes
  PruneFiles = yes
  PruneVolumes = yes
  Enabled = yes
  SpoolAttributes = yes
  Runscript {
RunsOnClient = no
RunsWhen = "Before"
Command = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
  }
  Runscript {
RunsOnClient = no
RunsWhen = "After"
Command = "/etc/bacula/scripts/delete_catalog_backup"
  }
  Runscript {
RunsOnClient = no
RunsWhen = "After"
Console = "run job=catalog-copy yes"
  }
  Priority = 11
}
Job {
  Name = "catalog-copy"
  Description = "copy of catalog"
  Type = "Copy"
  Level = "Full"
  Messages = "Standard"
  Storage = "dns-325-sd"
  Pool = "catalog"
  NextPool = "catalog-copy"
  Client = "none"
  Fileset = "none"
  Schedule = "sched_none"
  SelectionPattern = "catalog"
  SelectionType = "PoolUncopiedJobs"
}
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Bacula and german special chars "umlauts"

2024-04-09 Thread Stefan G. Weichinger

Am 09.04.24 um 08:38 schrieb Marcin Haba:

Hello Stefan,

Yes, filenames displayed in the restore process.

Also it might be good to check how the names are stored in the database 
in the File table if everything is fine there.


will try that in an hour or so.

currently editing Jobs and doing initial Full runs to test them

Let me ask something not related to umlauts here:

In Amanda I had "disk list entries" defined, one per Samba-share to 
backup ... and one for each virtual machine dump located on a samba 
share: Veeam dumps to a samba share, I let amanda and now bacula read 
that and push to tape.


The idea there is to have many DLEs (=disk list entries) to make use of 
the scheduler there: it creates a dynamic schedule every run and 
combines fulls and incrementals of the DLEs to meet the overall goals 
("create one full backup of this DLE within N days").


I still tend to define more Jobs in Bacula and not do huge Jobs 
containing hundreds of Gigs and multiple VMs in one Job.


That leads to more manual editing ;-) but OK; that's done now at 
migration time.


Is it recommended to use more Jobs? I assume it's quicker and easier to 
handle, for example at restore time etc


Any problems I create by doing so?

Thanks for any pointers here



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