[Bacula-users] Backing up OS X and Windows clients and keeping them awake

2014-01-19 Thread Joe Rhodes
For those that are backing up OS X clients, you may have noticed that 10.8 
Mountain Lion and later is much more militant about having machines sleep.  
Even if you issue a WOL packet to start a backup, they still fall back asleep 
pretty quickly unless there’s someone actually using the mouse and keyboard.  
It doesn’t really matter what you have the sleep timer set to.

Apple’s strategy seems to be that programs that need to run must issue a “power 
assertion” to the system, indicating that the system must stay awake for them 
complete their task.  Fortunately, it’s easy enough to issue one of these 
manually using the command line.

In my job definition (in the Bacula director configuration)  I’ve added this 
line to my Mac clients:

Client Run Before Job = "/usr/bin/screen -d -m /usr/bin/caffeinate -i -t 3600; 
sleep 0;”

The first part, using the “screen” command, puts the command in the background. 
 The “caffeinate” command is new for 10.8 and later, and will keep the system 
awake for 3600 seconds.  (Edit to suit your needs.)

If you’re backing up 10.7 or earlier systems, they won’t have the caffeinate 
command, so trying to issue it will fail and thus your backup would fail.  
That’s why there’s the “sleep 0” part at the end.  It ensures you’ll always 
exit this command with a success (0).  

Hopefully this will help someone else that gets stuck when a Mac backup starts 
but then fails, usually taking about 2 hours before the director will give up 
and move on.  

Windows 7 seems to have a similar issue.  I was able to solve that by editing a 
registry value as below:


[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e]
"AcSettingIndex"=dword:0e10

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c]
"AcSettingIndex"=dword:0e10

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\a1841308-3541-4fab-bc81-f71556f20b4a]
"AcSettingIndex"=dword:0e10

Cheers!
-Joe Rhodes



smime.p7s
Description: S/MIME cryptographic signature
--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] Backing up OS X and Windows clients and keeping them awake

2014-01-21 Thread Joe Rhodes
Sorry, turns out there was an error in my previous suggestion and “caffeinate” 
was not actually started on the client.  Here’s an updated  (and tested) line 
that does keep a 10.8 or later mac awake for 3600 seconds:

Client Run Before Job = "bash -c \"/usr/bin/caffeinate -i -t 3600 &> /dev/null 
< /dev/null &\""


Turns out, getting a command into the background using the “Client Run Before 
Job” was more tricky than I realized.  This command does the trick.  You’ll 
have to adjust the time (3600) to suit your needs.  (I’ve got one client that 
takes 4 hours to do a full backup.)

It also does not fail the job if the “caffeinate” command cannot be found (10.7 
or earlier clients).  So it should be safe to use that command for any OS X 
client.


Josh Fisher asked:

> I take there simply is no way to prevent sleep on 10.7 and earlier?

With 10.7 and earlier, things were actually simpler.  You just set the sleep 
timer in System Preferences (or using pmset from the command line) and the Mac 
would stay awake for whatever you had it set for, even from a WOL packet.  I’d 
typically set it for 2 hours on most machines.   I only started to get lots of 
failed jobs with 10.8 and later.  Thats’ where Apple got a lot more aggressive 
about power management.


> You wouldn't happen to know how to enable WoWLAN on a Mac would you?


Again, easily set in System Preferences or using pmset from the command line.  
If you’ve got a lot of Macs, Apple Remote Desktop is your friend here.  (“Send 
Unix Command” to the whole fleet)


Cheers!
-Joe Rhodes


> For those that are backing up OS X clients, you may have noticed that 10.8 
> Mountain Lion and later is much more militant about having machines sleep.  
> Even if you issue a WOL packet to start a backup, they still fall back asleep 
> pretty quickly unless there?s someone actually using the mouse and keyboard.  
> It doesn?t really matter what you have the sleep timer set to.
> 
> Apple?s strategy seems to be that programs that need to run must issue a 
> ?power assertion? to the system, indicating that the system must stay awake 
> for them complete their task.  Fortunately, it?s easy enough to issue one of 
> these manually using the command line.
> 
> In my job definition (in the Bacula director configuration)  I?ve added this 
> line to my Mac clients:
> 
> Client Run Before Job = "/usr/bin/screen -d -m /usr/bin/caffeinate -i -t 
> 3600; sleep 0;?
> 
> The first part, using the ?screen? command, puts the command in the 
> background.  The ?caffeinate? command is new for 10.8 and later, and will 
> keep the system awake for 3600 seconds.  (Edit to suit your needs.)
> 
> If you?re backing up 10.7 or earlier systems, they won?t have the caffeinate 
> command, so trying to issue it will fail and thus your backup would fail.  
> That?s why there?s the ?sleep 0? part at the end.  It ensures you?ll always 
> exit this command with a success (0).  
> 
> Hopefully this will help someone else that gets stuck when a Mac backup 
> starts but then fails, usually taking about 2 hours before the director will 
> give up and move on.  
> 
> Windows 7 seems to have a similar issue.  I was able to solve that by editing 
> a registry value as below:
> 
> 
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e]
> "AcSettingIndex"=dword:0e10
> 
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c]
> "AcSettingIndex"=dword:0e10
> 
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\a1841308-3541-4fab-bc81-f71556f20b4a]
> "AcSettingIndex"=dword:0e10
> 
> Cheers!
> -Joe Rhodes

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Backing up OS X and Windows clients and

2014-01-28 Thread Joe Rhodes
Well, as it turns out, there’s an slightly better way to do this, at least for 
now.  


>> 
> 
> I see. With 10.7 and earlier there is no way to "temporarily" adjust the 
> sleep timer. If a permanent long sleep timer is not desired, then it 
> would require the RunBefore script to set the sleep timer with pmset and 
> a RunAfter job to set it back to normal following the backup. My Mac 
> clients are in and out of the office seemingly at random. It is not 
> uncommon for the users to leave in the middle of a backup. Up grading to 
> 10.8 and using caffeinate seems to be my best option, else they will be 
> left with a long sleep timer while traveling should they leave in the 
> middle of a backup. It is a real pain trying to backup these "road 
> warrior" clients.
> 

There’s an option to pmset called “noidle” that will keep the mac awake as long 
as the command is running.  It runs in the foreground.  So here’s what I do:

  Client Run Before Job = "bash -c \"/usr/bin/pmset noidle &> /dev/null < 
/dev/null &\""
  Client Run After Job  = "/usr/bin/killall pmset"


The first command will run pmset with the “noidle” option in the background.  
This will keep the Mac awake.  The second one goes through and kills the pmset 
command after the backup is done, thus allowing it to fall asleep per it’s 
schedule.

That should take care of it for any recent OS X client, including 10.6 and up.  
Not sure about 10.5 and earlier.  It should also handle backup jobs of 
arbitrary time.

Also, if your Macs leave in the middle of a backup operation, they’ll have that 
running.  A restart will correct that.  So perhaps the “caffeinate” command is 
better for those folks.  At least that will expire on it’s own.

Note that the “noidle” option is deprecated as of 10.8 or 10.9 and Apple 
officially recommends using caffeinate instead.  So we might have to rethink 
this sometime with the next release of OS X.


Sorry for all the back and forth on this.  It’s something I’ve been wrestling 
with for a while.  I think this will be my final answer.  :)

Cheers!
-Joe Rhodes




>> 
>>> You wouldn't happen to know how to enable WoWLAN on a Mac would you?
>> 
>> Again, easily set in System Preferences or using pmset from the command 
>> line.  If you?ve got a lot of Macs, Apple Remote Desktop is your friend 
>> here.  (?Send Unix Command? to the whole fleet)
> 
> Thanks, Joe.
> 
>> 
>> Cheers!
>> -Joe Rhodes
>> 
>> 
>>> For those that are backing up OS X clients, you may have noticed that 10.8 
>>> Mountain Lion and later is much more militant about having machines sleep.  
>>> Even if you issue a WOL packet to start a backup, they still fall back 
>>> asleep pretty quickly unless there?s someone actually using the mouse and 
>>> keyboard.  It doesn?t really matter what you have the sleep timer set to.
>>> 
>>> Apple?s strategy seems to be that programs that need to run must issue a 
>>> ?power assertion? to the system, indicating that the system must stay awake 
>>> for them complete their task.  Fortunately, it?s easy enough to issue one 
>>> of these manually using the command line.
>>> 
>>> In my job definition (in the Bacula director configuration)  I?ve added 
>>> this line to my Mac clients:
>>> 
>>> Client Run Before Job = "/usr/bin/screen -d -m /usr/bin/caffeinate -i -t 
>>> 3600; sleep 0;?
>>> 
>>> The first part, using the ?screen? command, puts the command in the 
>>> background.  The ?caffeinate? command is new for 10.8 and later, and will 
>>> keep the system awake for 3600 seconds.  (Edit to suit your needs.)
>>> 
>>> If you?re backing up 10.7 or earlier systems, they won?t have the 
>>> caffeinate command, so trying to issue it will fail and thus your backup 
>>> would fail.  That?s why there?s the ?sleep 0? part at the end.  It ensures 
>>> you?ll always exit this command with a success (0).
>>> 
>>> Hopefully this will help someone else that gets stuck when a Mac backup 
>>> starts but then fails, usually taking about 2 hours before the director 
>>> will give up and move on.
>>> 
>>> Windows 7 seems to have a similar issue.  I was able to solve that by 
>>> editing a registry value as below:
>>> 
>>> 
>>> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e]
>>> "AcSettingIndex"=dword:0e10
>>> 
>>> [HKEY_LOCAL_MACHINE

Re: [Bacula-users] Backing up OS X and Windows clients and keeping them awake

2014-01-30 Thread Joe Rhodes
Kern:

I no very little about programming, but here’s the documentation for creating 
and releasing a power assertion on OS X.  There is a call “IOPMAssertionCreate” 
which is available in 10.5, then deprecated in 10.6.  Seems it was replaced 
with “IOPMAssertionCreateWithDescription” which came in 10.7.


https://developer.apple.com/library/mac/documentation/IOKit/Reference/IOPMLib_header_reference/Reference/reference.html#//apple_ref/doc/uid/TP40012430


I don’t know if that will help any or not.  It would be pretty awesome to see 
in Bacula.  Love that Windows will be getting that feature built in!

Cheers!
-Joe


> Hello,
> 
> The next Windows version to be released by Bacula Systems roughly in
> June -- it will
> be version 8.0 tells the Windows OS not to suspend the SD during a job.
> 
> For OSX, I don't know if an OS API exists to do this -- on Linux, it
> doesn't seem
> to have one, which means that it is not so simple.  If anyone has some
> simple
> OS API call for Linux or Mac OSX that will do this, please let me know.
> 
> Best regards,
> Kern
> 
> On 01/27/2014 04:50 PM, Josh Fisher wrote:
>> On 1/21/2014 6:25 PM, Joe Rhodes wrote:
>>> Sorry, turns out there was an error in my previous suggestion and 
>>> ?caffeinate? was not actually started on the client.  Here?s an updated  
>>> (and tested) line that does keep a 10.8 or later mac awake for 3600 seconds:
>>> 
>>> Client Run Before Job = "bash -c \"/usr/bin/caffeinate -i -t 3600 &> 
>>> /dev/null < /dev/null &\""
>>> 
>>> 
>>> Turns out, getting a command into the background using the ?Client Run 
>>> Before Job? was more tricky than I realized.  This command does the trick.  
>>> You?ll have to adjust the time (3600) to suit your needs.  (I?ve got one 
>>> client that takes 4 hours to do a full backup.)
>>> 
>>> It also does not fail the job if the ?caffeinate? command cannot be found 
>>> (10.7 or earlier clients).  So it should be safe to use that command for 
>>> any OS X client.
>>> 
>>> 
>>> Josh Fisher asked:
>>> 
>>>> I take there simply is no way to prevent sleep on 10.7 and earlier?
>>> With 10.7 and earlier, things were actually simpler.  You just set the 
>>> sleep timer in System Preferences (or using pmset from the command line) 
>>> and the Mac would stay awake for whatever you had it set for, even from a 
>>> WOL packet.  I?d typically set it for 2 hours on most machines.   I only 
>>> started to get lots of failed jobs with 10.8 and later.  Thats? where Apple 
>>> got a lot more aggressive about power management.
>> I see. With 10.7 and earlier there is no way to "temporarily" adjust the 
>> sleep timer. If a permanent long sleep timer is not desired, then it 
>> would require the RunBefore script to set the sleep timer with pmset and 
>> a RunAfter job to set it back to normal following the backup. My Mac 
>> clients are in and out of the office seemingly at random. It is not 
>> uncommon for the users to leave in the middle of a backup. Up grading to 
>> 10.8 and using caffeinate seems to be my best option, else they will be 
>> left with a long sleep timer while traveling should they leave in the 
>> middle of a backup. It is a real pain trying to backup these "road 
>> warrior" clients.
>> 
>>>> You wouldn't happen to know how to enable WoWLAN on a Mac would you?
>>> Again, easily set in System Preferences or using pmset from the command 
>>> line.  If you?ve got a lot of Macs, Apple Remote Desktop is your friend 
>>> here.  (?Send Unix Command? to the whole fleet)
>> Thanks, Joe.
>> 
>>> Cheers!
>>> -Joe Rhodes
>>> 
>>> 
>>>> For those that are backing up OS X clients, you may have noticed that 10.8 
>>>> Mountain Lion and later is much more militant about having machines sleep. 
>>>>  Even if you issue a WOL packet to start a backup, they still fall back 
>>>> asleep pretty quickly unless there?s someone actually using the mouse and 
>>>> keyboard.  It doesn?t really matter what you have the sleep timer set to.
>>>> 
>>>> Apple?s strategy seems to be that programs that need to run must issue a 
>>>> ?power assertion? to the system, indicating that the system must stay 
>>>> awake for them complete their task.  Fortunately, it?s easy enough to 
>>>> issue one of these manually using the command line.
>>>> 
>>>> In my job definition (in the Bacula director configura

Re: [Bacula-users] Backing up OS X and Windows clients and keeping them awake

2014-02-05 Thread Joe Rhodes
Peter:

If you run caffinate on 10.9, it runs in the foreground.  Same with “pmset 
noidle” command.  You have to take some measures to get it to run in the 
background on the client.  This took a little fooling around on my part before 
I got it right.

Here’s what I use in my bacular-dir.conf:

Client Run Before Job = "bash -c \"/usr/bin/pmset noidle &> /dev/null < 
/dev/null &\””

Client Run After Job  = "/usr/bin/killall pmset"


That should put the pmset command into the background, then kill it after the 
job has been run.  Watch the double quotes.  They have to be escaped.

It’s a little tricky to get bacula to run a “Client Run Before” command into 
the background.  You have to redirect it’s input and output.  If I’m seeing it 
correctly, I think you’ve got a space between the & and the > right after 
“noidle".  They should be  right on top of each other, no spaces.

See section 3.6 of this how-to:

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html



Cheers!
-Joe

On Feb 5, 2014, at 4:56 PM, Peter Wood  wrote:

> 
> On Tue, Jan 21, 2014 at 3:25 PM, Joe Rhodes  wrote:
> Sorry, turns out there was an error in my previous suggestion and 
> “caffeinate” was not actually started on the client.  Here’s an updated  (and 
> tested) line that does keep a 10.8 or later mac awake for 3600 seconds:
> 
> Client Run Before Job = "bash -c \"/usr/bin/caffeinate -i -t 3600 &> 
> /dev/null < /dev/null &\""
> 
> 
> With Bacula 5.2.13 running on CentOS6.4 the command doesn't go in on OS X 
> 10.9.1 client.
> 
> On the OS X system I see it running:
> sdfiler:~ root# ps -ef |grep caffeinate
> 0 48955 1   0 10:11AM ?? 0:00.01 /usr/bin/caffeinate -i -t 
> 21600
> 
> ... but the backup stops waiting for the command to complete before 
> continuing. If I kill the caffeinate process the backup continues instantly.
> 
> If I don't kill the caffeinate process the connection stays idle for 15min. 
> and the OS X closes it.
> 
> Here is the output:
> 05-Feb 10:11 tzbackup-dir JobId 3965: No prior Full backup Job record found.
> 05-Feb 10:11 tzbackup-dir JobId 3965: No prior or suitable Full backup found 
> in catalog. Doing FULL backup.
> 05-Feb 10:11 tzbackup-dir JobId 3965: shell command: run BeforeJob 
> "/usr/local/sbin/baculaFirewall open 192.168.10.40"
> 05-Feb 10:11 tzbackup-dir JobId 3965: Start Backup JobId 3965, 
> Job=sdfiler.2014-02-05_10.11.09_24
> 05-Feb 10:11 tzbackup-dir JobId 3965: Using Device "FileStorage" to write.
> 05-Feb 10:11 sdfiler-fd JobId 3965: shell command: run ClientRunBeforeJob 
> "bash -c "/usr/bin/caffeinate -i -t 21600 & > /dev/null < /dev/null &""
> 05-Feb 10:26 tzbackup-dir JobId 3965: Fatal error: Socket error on 
> ClientRunBeforeJob command: ERR=Connection reset by peer
> 05-Feb 10:26 tzbackup-dir JobId 3965: Fatal error: Client "sdfiler-fd" 
> RunScript failed.
> 05-Feb 10:26 tzbackup-dir JobId 3965: Fatal error: Network error with FD 
> during Backup: ERR=Connection reset by peer
> 05-Feb 10:26 tzbackup-dir JobId 3965: Fatal error: No Job status returned 
> from FD.
> 05-Feb 10:26 tzbackup-dir JobId 3965: Error: Bacula tzbackup-dir 5.2.13 
> (19Jan13):
>   Build OS:   x86_64-unknown-linux-gnu redhat
>   JobId:  3965
>   Job:sdfiler.2014-02-05_10.11.09_24
>   Backup Level:   Full (upgraded from Incremental)
>   Client: "sdfiler-fd" 5.2.13 (19Jan13) 
> i386-apple-darwin13.0.0,osx,13.0.0
>   FileSet:"sdfiler-files" 2014-02-05 09:57:47
>   Pool:   "FullFilePool" (From Job FullPool override)
>   Catalog:"MyCatalog" (From Client resource)
>   Storage:"File" (From Job resource)
>   Scheduled time: 05-Feb-2014 10:10:46
>   Start time: 05-Feb-2014 10:11:11
>   End time:   05-Feb-2014 10:26:14
>   Elapsed time:   15 mins 3 secs
>   Priority:   10
>   FD Files Written:   0
>   SD Files Written:   0
>   FD Bytes Written:   0 (0 B)
>   SD Bytes Written:   0 (0 B)
>   Rate:   0.0 KB/s
>   Software Compression:   None
>   VSS:no
>   Encryption: no
>   Accurate:   no
>   Volume name(s):
>   Volume Session Id:  688
>   Volume Session Time:1389056422
>   Last Volume Bytes:  78,232,168,558 (78.23 GB)
>   Non-fatal FD errors:1
>   SD Errors:  0
>   FD termination status:  Error
>   SD termination status:  OK
>   Termination:*** Backup Error ***
> 

[Bacula-users] Bacula 7 will only see the first storage resource in bacula-dir.conf

2014-07-15 Thread Joe Rhodes
Hey everyone!

I’m running Bacula 7.0.4 on Ubuntu 14.04.  I’m backing up to two different 
devices.  One is a hot-swap hard drive bay which I’m treating as a changer 
using the vchanger program.   These drives get changed out and rotated off 
site.   The other is a fixed drive.  The two devices will use two distinct 
pools.

The issue I’m having is that no matter what I do, Bacula seems to see the FIRST 
storage resource only.  This ultimately causes problems because bacula will 
look to the wrong device for volumes associated with the pool the job calls for.

I have a similar setup on a Bacula 5.2 setup that is working great.  So I’m not 
sure what I’m doing wrong.  Config files look the same between the two.   If 
anyone has some suggestions, I’d be eternally grateful.

The stanza’s from bacula-dir.com:

#
#
# Storage
#
#

# Definition of file Virtual Autochanger device
Storage {
  Name = removeable-drives
  Address = 10.11.1.2  # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "RoundHouseBackup"
  Device = ExternalDrives
  Media Type = File
  Maximum Concurrent Jobs = 1# run up to 10 jobs a the same time
}

Storage {
  Name = LocalStorage
  Address = 10.11.1.2  # N.B. Use a fully qualified name here
  SDPort = 9103
  Password = "RoundHouseBackup"
  Device = LocalStorage
  Media Type = File1
  Maximum Concurrent Jobs = 1# run up to 10 jobs a the same time
}


And the stanza’s from my bacula-sd.conf:


# Define a Virtual autochanger
#
Autochanger {
  Name = ExternalDrives
  Device = ExternalDrives-Drive1
  Changer Command = "/usr/local/bin/vchanger -u root  %c %o %S %a %d"
  Changer Device = "/etc/bacula/vchanger1.conf"
}

Device {
  Name = ExternalDrives-Drive1
  DriveIndex = 0
  Autochanger = yes
  DeviceType = File
  Media Type = File
  Archive Device = /var/lib/bacula/removeable-drives/0/drive0
  #LabelMedia = yes;   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;   # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 5;
  Maximum Volume Size = 476250 MB;  # with 8 volumes per drive, this should 
leave about 
# 4,800 MB free for other things, or about 
0.125%
}

Device {
  Name = LocalStorage
  Device Type = File
  Media Type = File1
  Archive Device = /mnt/localstorage/
  LabelMedia = yes;   # lets Bacula label unlabeled media
  Random Access = Yes;
  AutomaticMount = yes;   # when device opened, read it
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Volume Size = 237500 MB
}


When I execute “status sd” in bconsole, I get this:


*status sd
Automatically selected Storage: removeable-drives
Connecting to Storage daemon removeable-drives at 10.11.1.2:9103

mail.roundhouse.local-sd Version: 7.0.4 (04 June 2014) x86_64-unknown-linux-gnu 
ubuntu 14.04
Daemon started 15-Jul-14 21:55. Jobs: run=0, running=0.
 Heap: heap=270,336 smbytes=198,653 max_bytes=354,151 bufs=88 max_bufs=90
 Sizes: boffset_t=8 size_t=8 int32_t=4 int64_t=8 mode=0,0

Running Jobs:
No Jobs running.

…

Device status:
Autochanger "ExternalDrives" with devices:
   "ExternalDrives-Drive1" (/var/lib/bacula/removeable-drives/0/drive0)

Device "ExternalDrives-Drive1" (/var/lib/bacula/removeable-drives/0/drive0) is 
not open.
Drive 0 is not loaded.
==

Device "LocalStorage" (/mnt/localstorage/) is not open.
==


Used Volume status:




If I swap the order of the two “Storage” stanza’s in bacula-dir.cong, I get 
this:



*status sd
Automatically selected Storage: LocalStorage
Connecting to Storage daemon LocalStorage at 10.11.1.2:9103

mail.roundhouse.local-sd Version: 7.0.4 (04 June 2014) x86_64-unknown-linux-gnu 
ubuntu 14.04
Daemon started 15-Jul-14 21:55. Jobs: run=0, running=0.
 Heap: heap=270,336 smbytes=199,230 max_bytes=354,151 bufs=89 max_bufs=91
 Sizes: boffset_t=8 size_t=8 int32_t=4 int64_t=8 mode=0,0

Running Jobs:
No Jobs running.


...

Device status:
Autochanger "ExternalDrives" with devices:
   "ExternalDrives-Drive1" (/var/lib/bacula/removeable-drives/0/drive0)

Device "ExternalDrives-Drive1" (/var/lib/bacula/removeable-drives/0/drive0) is 
not open.
Drive 0 is not loaded.
==

Device "LocalStorage" (/mnt/localstorage/) is not open.
==


Used Volume status:


Notice how the “Automatically selected Storage:” line changes?  It just picks 
the first one and seems to ignore the other.  On the 5.2 install, I get a sub 
menu asking which Storage I want to get status on:

*status sd
The defined Storage resources are:
 1: File
 2: LocalStorage
Select Storage resource (1-2): 1


Hopefully someone can see what I’m doing wrong here.

Thanks!
-Joe








smime.p7s
Description: S/MIME cryptographic signature
--

[Bacula-users] VolumeRetention, Prune and Pool clarification

2014-07-26 Thread Joe Rhodes
Hi all!

I’ve been trying to figure something out, and I’m hoping someone can shed some 
light on this.  In the documentation regarding Automatic Volume Recycling, it 
has this to say about pruning:

"When a Job requests another volume and there are no Volumes with Volume Status 
Append available, Bacula will begin volume pruning. This means that all Jobs 
that are older than the VolumeRetention period will be pruned from every Volume 
that has Volume Status Full or Used and has Recycle set to yes.”

My question is, does this apply to the pool in question?   Or all jobs from all 
pools that are older than their respective Volume Retention periods pruned?

For example, if I have jobs/volumes in Pool A that are older than their volume 
retention period, but the job that’s running is looking for a volume in Pool B, 
will it cause the jobs/Volumes in Pool A to get pruned from the database?

Thanks!
-Joe Rhodes





smime.p7s
Description: S/MIME cryptographic signature
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] RecycleOldestVolume clarification

2014-07-26 Thread Joe Rhodes
Hi again!

I’m trying to wrap my head around the option “RecycleOldestVolume=yes”.  I’m 
not entirely clear where it would do anything that isn’t all ready part of the 
volume recycling algorithm. 

The documentation explains the volume search/recycling algorithm, including 
this step:

• Prune volumes applying Volume retention period (Volumes with 
VolStatus Full, Used, or Append are pruned). Note, even if all the File and Job 
records are pruned from a Volume, the Volume will not be marked Purged until 
the Volume retention period expires.


Then in a later step, it says this:

• Prune the oldest Volume if RecycleOldestVolume=yes (the Volume with 
the oldest LastWritten date and VolStatus equal to Full, Recycle, Purged, Used, 
or Append is chosen). This record ensures that all retention periods are 
properly respected.

Wouldn’t this all ready have been done by the pruning in the  previous step?  
If RecycleOldestVolume respects all the volume retention periods, I’m not clear 
how it differs from the normal Prune operation that would otherwise happen.

Or am I missing the purpose of this directive?  Perhaps a simple scenario where 
it would make a difference?

Thanks!
-Joe Rhodes



smime.p7s
Description: S/MIME cryptographic signature
--
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Recycling issue

2014-08-05 Thread Joe Rhodes
I’m also running into this issue.  

In my case, I’ve setup a disk-based auto-changer (vchanger) with two pools:  
Full and Weekly.  Each pool has multiple drives with 8 volumes on each drive.  
The script that mounts the disk also issues an “update slots” command in 
bconsole, and I can verify that bacula sees the correct volumes as “InChanger”.

When I swap out disks (weekly), Bacula continues to look for volumes that were 
append-able, but on the previous disk (and not currently marked as “InChanger”) 
and refuses to write to the append-able volumes on the new disk that are marked 
as “InChanger”.  It marks all the previous volumes it cannot access as “Error”, 
and only then will it begin writing to the currently loaded volumes.

This  line from the “Recycling Algorithm” led me to believe that it would use a 
volume that was InChanger first:  "If the request is for an Autochanger device, 
look only for Volumes in the Autochanger (i.e. with InChanger set and that have 
the correct Storage device).”

But it seems I’m missing something.  I’ve included relevant bits from my 
bacula-dir.conf file if anyone can see what I’m doing wrong.  I’m getting this 
on two systems, one running Bacula 5.2.12 and one running 7.0.4.

My other option is to split these all into separate pools, but that’s going to 
make scheduling much harder.

Thanks in advance!
-Joe Rhodes


# Definition of file Virtual Autochanger device

Storage {
  Name = removeable-drives
  Address = 10.11.1.2
  SDPort = 9103
  Password = “password"
  Device = ExternalDrives
  Media Type = File
  Maximum Concurrent Jobs = 1
}

# Pools
Pool {
  Name = FullSet
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Use Duration = 1 week
  #We're on an 2 month rotation
  VolumeRetention = 58 days
  Maximum Volumes = 32  # 4 drives with 8 volumes on each
  Storage = removeable-drives
}


Pool {
  Name = Weekly
  Pool Type = Backup
  Recycle = yes
  AutoPrune = yes
  Volume Use Duration = 1 week
  VolumeRetention =  3 weeks
  Maximum Volumes = 40  # 5 drives with 8 volumes on each
  Storage = removeable-drives
}


And my bacula-sd.conf:

# Define a Virtual autochanger

Autochanger {
  Name = ExternalDrives
  Device = ExternalDrives-Drive1
  Changer Command = "/usr/local/bin/vchanger -u root  %c %o %S %a %d"
  Changer Device = "/etc/bacula/vchanger1.conf"
}

Device {
  Name = ExternalDrives-Drive1
  DriveIndex = 0
  Autochanger = yes
  DeviceType = File
  Media Type = File
  Archive Device = /var/lib/bacula/removeable-drives/0/drive0
  Random Access = Yes;
  AutomaticMount = yes;  
  RemovableMedia = no;
  AlwaysOpen = no;
  Maximum Concurrent Jobs = 5;
  Maximum Volume Size = 476250 M;  # with 8 volumes per drive, this should 
leave about 
# 4,800 MB free for other things, or about 
0.125%
}




> From: Gael Guilmin 
> Subject: [Bacula-users] Recycling issue
> To: "bacula-users@lists.sourceforge.net"
>   
> Message-ID:
>   
> <05520d1d14f2408f8d048f1e1dfe6...@blupr07mb836.namprd07.prod.outlook.com>
>   
> Content-Type: text/plain; charset="us-ascii"
> 
> Hello,
> I'm facing an issue with Bacula (5.2.12) on a Ubuntu server (12.04.4 LTS): I 
> don't know why, but the server, after finishing writing on a tape, tries to 
> use a tape that is not in the autochanger, despite the fact that there are 
> plenty of online and usable tape in the Scratch pool...
> 
> Any idea?
> 
> Best regards,
> Gael
> --
> System Administrator / IT
> [PDM_Logo_RGB - registered]
> 78, Avenue du XXeme Corps
> 54000 Nancy
> France
> Phone(Paris): +33 (0)1 49 49 05 25
> Phone(Nancy): +33 (0)3 83 67 66 39
> Cell: +33 (0)6 10 18 48 43
> Web: www.pdgm.com<http://www.pdgm.com/>
--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Recycling issue

2014-08-06 Thread Joe Rhodes
t; 
(/var/lib/bacula/removeable-drives/0/drive0).
04-Aug 23:51 mail.roundhouse.local-sd JobId 298: Marking Volume 
"removeable-drives_0006_0005" in Error in Catalog.
04-Aug 23:51 mail.roundhouse.local-sd JobId 298: Warning: mount.c:212 Open of 
file device "ExternalDrives-Drive1" 
(/var/lib/bacula/removeable-drives/0/drive0) Volume 
"removeable-drives_0006_0005" failed: ERR=file_dev.c:172 Could not 
open(/var/lib/bacula/removeable-drives/0/drive0,OPEN_READ_WRITE,0640): ERR=No 
such file or directory

04-Aug 23:51 mail.roundhouse.local-sd JobId 298: Please mount append Volume 
"removeable-drives_0006_0005" or label a new one for:
   Job:  Server.2014-08-04_18.00.00_33
   Storage:  "ExternalDrives-Drive1" 
(/var/lib/bacula/removeable-drives/0/drive0)
   Pool: Weekly
   Media type:   File
04-Aug 23:56 mail.roundhouse.local-sd JobId 298: Warning: mount.c:212 Open of 
file device "ExternalDrives-Drive1" 
(/var/lib/bacula/removeable-drives/0/drive0) Volume 
"removeable-drives_0006_0006" failed: ERR=file_dev.c:172 Could not 
open(/var/lib/bacula/removeable-drives/0/drive0,OPEN_READ_WRITE,0640): ERR=No 
such file or directory

05-Aug 00:01 mail.roundhouse.local-sd JobId 298: Warning: mount.c:212 Open of 
file device "ExternalDrives-Drive1" 
(/var/lib/bacula/removeable-drives/0/drive0) Volume 
"removeable-drives_0006_0006" failed: ERR=file_dev.c:172 Could not 
open(/var/lib/bacula/removeable-drives/0/drive0,OPEN_READ_WRITE,0640): ERR=No 
such file or directory

05-Aug 00:05 mail.roundhouse.local-sd JobId 298: Fatal error: Job 298 canceled.
05-Aug 00:05 mail.roundhouse.local-dir JobId 298: Bacula 
mail.roundhouse.local-dir 7.0.4 (04Jun14):
 Build OS:   x86_64-unknown-linux-gnu ubuntu 14.04
 JobId:  298
 Job:Server.2014-08-04_18.00.00_33
 Backup Level:   Incremental, since=2014-08-01 23:18:37
 Client: "server" 7.0.4 (04Jun14) 
x86_64-unknown-linux-gnu,ubuntu,14.04
 FileSet:"Linux Server" 2014-07-10 13:39:56
 Pool:   "Weekly" (From Run Pool override)
 Catalog:"MyCatalog" (From Client resource)
 Storage:"removeable-drives" (From Pool resource)
 Scheduled time: 04-Aug-2014 18:00:00
 Start time: 04-Aug-2014 18:00:41
 End time:   05-Aug-2014 00:05:51
 Elapsed time:   6 hours 5 mins 10 secs
 Priority:   10
 FD Files Written:   0
 SD Files Written:   0
 FD Bytes Written:   0 (0 B)
 SD Bytes Written:   0 (0 B)
 Rate:       0.0 KB/s
 Software Compression:   None
 VSS:no
 Encryption: no
 Accurate:   no
 Volume name(s): 
 Volume Session Id:  110
 Volume Session Time:1406833087
 Last Volume Bytes:  241 (241 B)
 Non-fatal FD errors:0
 SD Errors:  1
 FD termination status:  Canceled
 SD termination status:  Canceled
 Termination:Backup Canceled







On Aug 6, 2014, at 1:41 AM, Kern Sibbald  wrote:

> Hello,
> 
> Probably 95% of all such problems are due to configurations where the 
> MediaType is not properly set. 
> 
> - If you are using any form of autochanger, each autochanger must have a 
> *unique* MediaType.
> 
> - Each Device configuration in the SD must have a unique MediaType for each 
> different ArchiveDevice definition.  Said the other way around, each 
> ArchiveDevice definition must have its own unique MediaType.
> 
> The .conf files you list are incomplete, so it is not possible to analyze 
> them, but when I see:  MediaType = File, that raises a red flag that 
> indicates that there may be other Storage devices with the same MediaType, 
> and if that is the case, sooner or later, you will find that Bacula is very 
> confused.
> 
> In the next Bacula version, I will probably modify the SD and possibly the 
> Dir to require unique MediaTypes, then this problem will be resolved.
> 
> I don't usually supply "support"  because I don't have the time, but this 
> particular problem interests me from the standpoint that I would like to 
> prevent it, but with no console/job output showing the failures and 
> incomplete DIR and SD confs I cannot do any more.
> 
> Best regards,
> Kern
> 
> On 08/05/2014 03:08 PM, Joe Rhodes wrote:
>> I’m also running into this issue.  
>> 
>> In my case, I’ve setup a disk-based auto-changer (vchanger) with two pools:  
>> Full and Weekly.  Each pool has multiple drives with 8 volumes on each 
>> drive.  The script that mounts the disk also issues an “update slots” 
>> command in bconsole, and I can verify that bacula sees the correct volumes 
>> as “InChanger”.
>> 
>> When

Re: [Bacula-users] Recycling issue

2014-08-10 Thread Joe Rhodes
Adding the line:

Autochanger = yes

to my storage definition in my bacula-dir.conf file did indeed solve the issue. 
 Bacula is now considering volumes only from the ones that are listed as 
“InChanger”.  Thanks for the pointer.

Cheers!
-Joe

On Aug 6, 2014, at 6:52 AM, Martin Simmons  wrote:

>> On Wed, 6 Aug 2014 06:52:06 +, Gael Guilmin said:
>> 
>> Here is my Storage definition in bacula-dir.conf:
>> Storage {
>> Name = Autochanger
>> Address = 192.168.27.7 # name or IP address of the server that hosts the 
>> daemon storage
>> SDPort = 9103
>> Password = ""
>> Device = "Autochanger" # the same as defined in bacula-sd.conf
>> Media Type = LTO-5
>> }
> 
> You need to add
> 
> Autochanger = yes
> 
> to this bacula-dir definition, otherwise Bacula will not apply the InChanger
> logic.  I think this is missing from most of the examples.
> 
> __Martin


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


[Bacula-users] wxConsole compile on OS X 10.4

2006-07-22 Thread Joe Rhodes
Hello all!

I'm trying to get the wxConsole component of bacula to compile on my  
OS X box, but I'm running into errors:

Joe-Rhodes:/Users/joe/Desktop/bacula-1.38.11/src/wx-console root# make
/usr/bin/g++   -c  -DHAVE_WXCONSOLE -I/usr/lib/wx/include/mac-ansi- 
release-2.6 -I/usr/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 - 
D_LARGE_FILES -DNO_GCC_PRAGMA -DHAVE_MACOSX -DNO_GCC_PRAGMA  \
   -I. -I..   -g -O2 -Wall  main.cpp
/usr/bin/g++   -c  -DHAVE_WXCONSOLE -I/usr/lib/wx/include/mac-ansi- 
release-2.6 -I/usr/include/wx-2.6 -D__WXMAC__ -D_FILE_OFFSET_BITS=64 - 
D_LARGE_FILES -DNO_GCC_PRAGMA -DHAVE_MACOSX -DNO_GCC_PRAGMA  \
   -I. -I..   -g -O2 -Wall  console_thread.cpp
/usr/include/wx-2.6/wx/list.h: In constructor 'wxListKey::wxListKey 
(const wxChar*)':
/usr/include/wx-2.6/wx/list.h:366: error:  
'bad_call_on_strdup_use_bstrdup' was not declared in this scope
/usr/include/wx-2.6/wx/list.h: In constructor 'wxListKey::wxListKey 
(const wxString&)':
/usr/include/wx-2.6/wx/list.h:368: error:  
'bad_call_on_strdup_use_bstrdup' was not declared in this scope
make: *** [console_thread.o] Error 1


Here are the important specs:

OS X 10.4.7 (ppc)
Bacula  1.38.11
wxWidgets  (wxMac) 2.6.3

I've complied wxWidgets with:

./configure --prefix=/usr

and bacula claims to have found my wxWidgets 2.6 libraries.  (OS X  
ships with 2.5.)

Large file support: no
   Bacula conio support:   yes -ltermcap
   readline support:   no
   TCP Wrappers support:   no
   TLS support:no
   ZLIB support:   yes
   enable-smartalloc:  yes
   enable-gnome:   no
   enable-wx-console:  yes wxWidgets 2.6
   enable-tray-monitor:
   client-only:no
   build-dird: yes
   build-stored:   yes
   ACL support:yes
   Python support: no


I've found one other thread in the mailing list that pertained to  
this, but I didn't see a resolution.  I haven't been able to turn  
much up on Google either.

Any help would be greatly appreciated.

Cheers!
-Joe Rhodes

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users