Re: [Bacula-users] How to remove all volumes?

2022-03-21 Thread Justin Case
Thank you Chris and Martin!

What I then did was use the Baculum Volumes view, filter for all volumes that 
are not purged and set them to Purged. It is easier in Baculum than I initially 
thought.
Then I used a job to run: truncate volume allpools storage=mystorage 

That was easy enough for me, but it is great to have Chris’es scripts now!

All the best
JC


> On 21. Mar 2022, at 16:48, Chris Wilkinson  wrote:
> 
> I wrote a couple of scripts to help with this problem. Start by deleting all 
> the jobs that you don’t want anymore. This should mark all the associated 
> volumes as ‘purged’. That can be done in bconsole or Baculum.
> 
> This one deletes any ‘purged’ volume records from the catalog.
> 
> #!/bin/bash
> #Usage: sudo ./delete-purged-volumes.sh any-char
> #Delete purged Bacula volumes. Do not delete if arg is empty
> if [[ -z $1 ]]; then
>   echo "Not deleting"
> fi
> for vol in $(echo "list volume" | bconsole | grep Purged | awk '{print $4}')
> do
>   if [[ ! -z $1 ]]; then
> echo "delete yes volume=$vol" | bconsole > /dev/null
> echo "Volume $vol deleted"
>   else
> echo "Volume $vol not deleted"
>   fi
> done
> 
> This one deletes any volumes from the filesystem that are not now in the 
> catalog. These are files in the filesystem that have no entry in the catalog.
> 
> #!/bin/bash
> #Usage: sudo -u bacula ./delete-orphened-volumes.sh target-dir any-char
> #Delete orphaned Bacula volumes. Do not delete if second arg is empty
> if [[ -z $1 ]]; then
>   echo "Please supply target directory"
>   exit
> fi
> if [[ ! -d $1 ]]; then
>   echo "Target does not exist"
>   exit
> fi
> if [[ -z $2 ]]; then
>   echo "Not deleting"
> fi
> cd $1  # change to target directory
> for vol in $(find . -maxdepth 1 -type f -printf '%f\n')
> do
>   echo "list volume=$vol" | bconsole | if grep --quiet "No results to list"; 
> then
> if [[ ! -z $2 ]]; then
>   rm $1$vol
>   echo "Orphaned file $1$vol deleted"
> else
>   echo "Orphaned file $1$vol not deleted"
> fi
>   fi
> done
> 
> Best
> -Chris-
> 
> 
> 
> 
>> On 21 Mar 2022, at 12:42, Martin Simmons > > wrote:
>> 
>> You can use the "delete volume" command in bconsole to remove a volume from
>> the catalog.  After that, you can safely rm it from the filesystem.
>> 
>> __Martin
>> 
>> 
>>> On Sat, 19 Mar 2022 13:08:41 +0100, Justin Case said:
>>> 
>>> Dear all,
>>> 
>>> again another newbie question:
>>> 
>>> I need to use a different disk drive for Bacula and I would like to start 
>>> over in the sense of deleting all volume files in a clean way, i.e. not 
>>> corrupting the catalog. The goal is to free up the space occupied by all 
>>> Bacula volumes.
>>> 
>>> I know that I could migrate all volumes, but that takes more time than 
>>> starting over. Losing all backups of the past few days after setting up 
>>> Bacula is OK for me.
>>> 
>>> I checked the manual what else I could do and it seems that one way would 
>>> be to set each volume manually to purged, but that would not delete the 
>>> volume but it would just be recycled/re-used. That would basically not help 
>>> me to free the space on the disk currently used by Bacula. Also it would be 
>>> a manual effort as I already have >150 volumes.
>>> 
>>> All the best,
>>> JC
>>> 
>>> 
>>> 
>>> 
>>> 
>>> ___
>>> 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 mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Packet size too big (NOT a version mismatch)

2022-03-21 Thread David Brodbeck
On Wed, Jan 5, 2022 at 6:53 AM Graham Sparks  wrote:

> I've just checked the "Privacy" screen and I actually have "bacula-fd",
> "bacula", "bconsole" AND "sh" in the Full Disk Access list.  I probably
> shouldn't have "sh" in that list.  That might actually be worse than your
> suggestion to run "csrutil disable" .
>
> I suppose running "csrutil disable" as a 'Client Run Before Job' script,
> then enabling again afterwards is an option, but I agree---after a certain
> point it feels as though another solution may be simpler.
>

That won't work because "csrutil disable" can only be run in recovery mode.

What I've decided to do is shift away from using bacula to back up macOS
hosts and use Time Machine to a central Samba server instead. I lose some
central manageability this way but it seems to be much more reliable, and
avoids having to install Xcode and compile bacula-fd on the client, as well
as keeping macOS's security features intact. A further benefit is I can do
"bare metal" restores using the standard macOS installer and Migration
Assistant.

-- 
David Brodbeck (they/them)
System Administrator, Department of Mathematics
University of California, Santa Barbara
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How to remove all volumes?

2022-03-21 Thread Chris Wilkinson
I wrote a couple of scripts to help with this problem. Start by deleting all 
the jobs that you don’t want anymore. This should mark all the associated 
volumes as ‘purged’. That can be done in bconsole or Baculum.

This one deletes any ‘purged’ volume records from the catalog.

#!/bin/bash
#Usage: sudo ./delete-purged-volumes.sh any-char
#Delete purged Bacula volumes. Do not delete if arg is empty
if [[ -z $1 ]]; then
  echo "Not deleting"
fi
for vol in $(echo "list volume" | bconsole | grep Purged | awk '{print $4}')
do
  if [[ ! -z $1 ]]; then
echo "delete yes volume=$vol" | bconsole > /dev/null
echo "Volume $vol deleted"
  else
echo "Volume $vol not deleted"
  fi
done

This one deletes any volumes from the filesystem that are not now in the 
catalog. These are files in the filesystem that have no entry in the catalog.

#!/bin/bash
#Usage: sudo -u bacula ./delete-orphened-volumes.sh target-dir any-char
#Delete orphaned Bacula volumes. Do not delete if second arg is empty
if [[ -z $1 ]]; then
  echo "Please supply target directory"
  exit
fi
if [[ ! -d $1 ]]; then
  echo "Target does not exist"
  exit
fi
if [[ -z $2 ]]; then
  echo "Not deleting"
fi
cd $1  # change to target directory
for vol in $(find . -maxdepth 1 -type f -printf '%f\n')
do
  echo "list volume=$vol" | bconsole | if grep --quiet "No results to list"; 
then
if [[ ! -z $2 ]]; then
  rm $1$vol
  echo "Orphaned file $1$vol deleted"
else
  echo "Orphaned file $1$vol not deleted"
fi
  fi
done

Best
-Chris-




> On 21 Mar 2022, at 12:42, Martin Simmons  wrote:
> 
> You can use the "delete volume" command in bconsole to remove a volume from
> the catalog.  After that, you can safely rm it from the filesystem.
> 
> __Martin
> 
> 
>> On Sat, 19 Mar 2022 13:08:41 +0100, Justin Case said:
>> 
>> Dear all,
>> 
>> again another newbie question:
>> 
>> I need to use a different disk drive for Bacula and I would like to start 
>> over in the sense of deleting all volume files in a clean way, i.e. not 
>> corrupting the catalog. The goal is to free up the space occupied by all 
>> Bacula volumes.
>> 
>> I know that I could migrate all volumes, but that takes more time than 
>> starting over. Losing all backups of the past few days after setting up 
>> Bacula is OK for me.
>> 
>> I checked the manual what else I could do and it seems that one way would be 
>> to set each volume manually to purged, but that would not delete the volume 
>> but it would just be recycled/re-used. That would basically not help me to 
>> free the space on the disk currently used by Bacula. Also it would be a 
>> manual effort as I already have >150 volumes.
>> 
>> All the best,
>> JC
>> 
>> 
>> 
>> 
>> 
>> ___
>> 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 mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] How to remove all volumes?

2022-03-21 Thread Martin Simmons
You can use the "delete volume" command in bconsole to remove a volume from
the catalog.  After that, you can safely rm it from the filesystem.

__Martin


> On Sat, 19 Mar 2022 13:08:41 +0100, Justin Case said:
> 
> Dear all,
> 
> again another newbie question:
> 
> I need to use a different disk drive for Bacula and I would like to start 
> over in the sense of deleting all volume files in a clean way, i.e. not 
> corrupting the catalog. The goal is to free up the space occupied by all 
> Bacula volumes.
> 
> I know that I could migrate all volumes, but that takes more time than 
> starting over. Losing all backups of the past few days after setting up 
> Bacula is OK for me.
> 
> I checked the manual what else I could do and it seems that one way would be 
> to set each volume manually to purged, but that would not delete the volume 
> but it would just be recycled/re-used. That would basically not help me to 
> free the space on the disk currently used by Bacula. Also it would be a 
> manual effort as I already have >150 volumes.
> 
> All the best,
>  JC
> 
> 
> 
> 
> 
> ___
> 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] An special day for honoring someone who has done a extremely nice job in the open source world

2022-03-21 Thread egoitz--- via Bacula-users
Good morning people :) 

Today is a special day. Is the birthday of someone now deservedly
retired. This person is Kern Sibbald. I had the opportunity of knowing
about his birthday, through one nice person in this mailing lists. Kern
is much more than a nice codder, who has write a extremely important
tool which is the base of most of our backups. At least for me is one of
my mentors, one of the persons from which I would like to learn because
it has done a nice job with Bacula. For all these reasons, I wanted to
say "thank you so much Kern and have an extremely happy birthday!!". 

I wanted too, for making the most of this lines, to ask a little gift to
Kern :) :). I'm working as some of you know, in building a Bacula
pluggin for creating an open source delta encoding plugin for the fd. It
would be hugely nice :) :) (as someone told me too in this list) if
official Delta plugin of Bacula, could be distributed with the Community
source of Bacula. I'll go on writting my own plugin anyway, because I
wanted to learn how it works and for being able to customize some of the
backups I do here, but it would be really nice to have the Delta plugin
as part of the Community edition of this nice piece of software. I had
to try :) :) . 

Anyway and independently of what Kern decides about the gift I have
asked :) :) (I had to try it... mainly after someone encouraged asking
it :) :) ), I wanted to emphasize my recognition about Kern's person,
due to all his contributions to the open source world. These ideas,
anyway, would never change in my mind about you. 

So for ending this email, I think there are not more appropiate words
for being remarked as the following ones : "Kern, Thank you so much". 

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


Re: [Bacula-users] Baculum for Raspberry PI B?

2022-03-21 Thread Marcin Haba
Hello Chris,

Thanks for your test and feedback.

For this division error now I am seeing it on my side too. Thanks for the
offer sending API and Web logs. Since I am able to reproduce it, the logs
are not needed.

I will try to fix it in the near future.

Best regards,
Marcin Haba (gani)

On Sat, 19 Mar 2022 at 12:21, Chris Wilkinson 
wrote:

> Hello Marcin
>
> The patch was applied successfully and now I am able to set a volume max
> bytes to larger values (>4GB) and the save is OK.
>
> However there is now another error when I click on the details of the pool.
>
> DivisionByZeroError Description
>
> Modulo by zero
> Source File
>
> /var/www/baculum/protected/Web/Portlets/DirectiveSize.php (117)
>
> 0106:  * Example:
> 0107:  *  size_value: 121000
> 0108:  *  given format: b
> 0109:  *  returned value: 121
> 0110:  *  returned format: kb
> 0111:  */
> 0112: private function formatSize($size_bytes, $format) {
> 0113: $value = $size_bytes;
> 0114: if ($value > 0) {
> 0115: for ($i = (count($this->size_formats) - 1); $i >= 0; $i--) {
> 0116: if ($this->size_formats[$i]['format'] != $format) {
> 0117: $remainder = $value % 
> $this->size_formats[$i]['value'];
> 0118: if ($remainder == 0) {
> 0119: $value /= $this->size_formats[$i]['value'];
> 0120: $format = $this->size_formats[$i]['format'];
> 0121: break;
> 0122: }
> 0123: }
> 0124: }
> 0125: }
> 0126: return array('value' => $value, 'format' => $format);
> 0127: }
> 0128:
> 0129: private function getValueBytes($value, $size_format) {
>
>
> I have saved the API and WEB logs but I don’t think I can send the 
> attachments to the list?
>
> I’m going to upgrade Raspbian to 64 bit so will not have the 32 bit 
> environment to do any further testing
>
> I’ll report back on how that goes.
>
> Best
> -Chris-
>
>
>
>
> On 17 Mar 2022, at 02:58, Marcin Haba  wrote:
>
> Hello Chris,
>
> You can copy the patch to this directory:
>
> /var/www/baculum/protected/API/Class/
>
> and then go to this directory:
>
> cd /var/www/baculum/protected/API/Class/
>
> check if patch is applying:
>
> patch -p6 --dry-run < baculum_fix_save_resource_32bit.patch
>
> and if yes then finally run:
>
> patch -p6 < baculum_fix_save_resource_32bit.patch
>
> Good luck.
>
> Best regards,
> Marcin
>
> On Wed, 16 Mar 2022 at 21:49, Chris Wilkinson 
> wrote:
>
>> When I look at this patch, it seems to be for a tree that doesn't match
>> what I have.
>>
>> The file to be patched is located at
>> /var/www/baculum/protected/API/Class/.. in my tree. Do I need to drop the
>> 'gui' in the patch?
>>
>> I am on v9.6.7
>>
>> My knowledge of patching is sketchy at best so would it possible to send
>> some instructions on applying it?
>>
>> Best
>> Chris
>>
>> On Wed, 16 Mar 2022, 9:05 am Chris Wilkinson, 
>> wrote:
>>
>>> Thank you Marcin for this patch. I’d expected it to be a lot more
>>> complicated than that. I’ll check it out and let you know.
>>>
>>> Best
>>> -Chris-
>>>
>>>
>>>
>>>
>>> On 16 Mar 2022, at 06:17, Marcin Haba  wrote:
>>>
>>> 
>>>
>>>
>>>
>
> --
> "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
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users