Bacula-users

Re: [Bacula-users] [SPAM] Bacula "TimeMachine" type SOHO config?

2009-12-06 05:23:26
Subject: Re: [Bacula-users] [SPAM] Bacula "TimeMachine" type SOHO config?
From: "Timo Neuvonen" <timo-news AT tee-en DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Sun, 6 Dec 2009 12:18:26 +0200
"Simon J Mudd" <sjmudd AT pobox DOT com> kirjoitti viestissä 
news:20091206082523.GA612 AT mad06.wl0 DOT org...
> Hello,
>
> I've been using Bacula for some time for home use, and trying to get
> a working "TimeMachine" type configuration working.
>
> That is I'd like to configure bacula to store to an external hard disk
> using a number of fixed sizes files, occupying up to a certain amount
> of disk space. In my case 100 x 2GB files. I'd like to auto label
> new files and purge old ones automatically to make space if needed.
>
> This sounds like a simple recipe which is appropriate for a large number
> of SOHO type situations. I know Bacula can do more, but to minimise
> intervention this looks nice.
>
> However, I don't quite get this to work. I've had issues with getting
> the auto-label to always work, and also the auto-expire. I wonder
> if anyone can look at my configuration or offer an alternative to do
> this?
>

I guess "Time Machine" is something Apple-like, and I don't know nothing 
about it but the name. But if what you told is the essential, that is the 
disk usage strategy, it shouldn't be a problem though minor differences 
might exist.

I didn't notice "Volume Retention" specified in your Pool config. I controls 
how soon after the last write the volumes can be recycled. Since you make 
full backup once a month, this should be set to the minimum of more than one 
month (eg. 40 days) to make sure you'll always have at least one (I'd 
seriously recommend more, at least two) full backup(s) available. After this 
period, if necessary, Bacula _can_ recycle the existing volumes. However, 
actual recycle won't happen until really needed to free the previously used 
volumes, but it can't happen before this time limit has expired.

Also remember that modifying the pool parameters in the conf does not 
automatically apply to the existing volumes, only to the new ones created 
thereafter. To make the existing volumes to obey the new values, you'll need 
to use the update pool / update volumes from pool commands from the bacula 
console.


Regards,
Timo




> So currently I'm getting errors like this (taken a few days ago):
>
> 01-Dec 06:05 mad06-sd JobId 1869: Job mad06-job.2009-11-29_23.05.00_02 
> waiting. Cannot find any appendable volumes.
> Please use the "label"  command to create a new Volume for:
>    Storage:      "FileStorage1" (/bacula/2)
>    Pool:         DISK_POOL
>    Media type:   File
>
> *status dir
> mad06-dir Version: 3.0.1 (30 April 2009) x86_64-redhat-linux-gnu redhat
> Daemon started 29-Nov-09 09:53, 0 Jobs run since started.
> Heap: heap=249,856 smbytes=99,692 max_bytes=125,113 bufs=378 max_bufs=379
>
> Scheduled Jobs:
> Level          Type     Pri  Scheduled          Name               Volume
> ===================================================================================
> Incremental    Backup    10  01-Dec-09 23:05    mad06-job 
> *unknown*
> Full           Backup    11  01-Dec-09 23:10    BackupCatalog 
> *unknown*
> Incremental    Backup    10  02-Dec-09 11:05    mad06-job 
> *unknown*
> ====
>
> Running Jobs:
> Console connected at 01-Dec-09 19:50
> JobId Level   Name                       Status
> ======================================================================
>  1869 Differe  mad06-job.2009-11-29_23.05.00_02 is waiting for an 
> appendable Volume
>  1870 Full    BackupCatalog.2009-11-29_23.10.00_03 is waiting execution
>  1871 Increme  mad06-job.2009-11-30_11.05.00_04 is waiting execution
>  1872 Increme  mad06-job.2009-11-30_23.05.00_05 is waiting execution
>  1873 Full    BackupCatalog.2009-11-30_23.10.00_06 is waiting execution
>  1874 Increme  mad06-job.2009-12-01_11.05.00_07 is waiting execution
> ====
>
> Terminated Jobs:
> JobId  Level    Files      Bytes   Status   Finished        Name
> ====================================================================
>  1857  Full          0         0   Error    24-Nov-09 08:35 BackupCatalog
>  1848  Incr          0         0   Error    24-Nov-09 08:35 mad06-job
>  1854  Full          0         0   Error    24-Nov-09 08:35 BackupCatalog
>  1853  Diff          0         0   Error    24-Nov-09 08:35 mad06-job
>  1852  Full          0         0   Error    24-Nov-09 08:35 BackupCatalog
>  1850  Incr          0         0   Error    24-Nov-09 08:35 mad06-job
>  1849  Full          0         0   Error    24-Nov-09 08:35 BackupCatalog
>  1851  Incr          0         0   Error    24-Nov-09 08:35 mad06-job
>  1855  Incr          0         0   Error    24-Nov-09 08:35 mad06-job
>  1856  Incr          0         0   Error    24-Nov-09 08:35 mad06-job
>
> ====
> *
>
> # ls -l /bacula/2    ### this is where the disks are located, on an 
> external NAS mounted by NFS.
> total 28705668
> -rw-r-----+ 1 bacula    disk    372483112 Nov 13 11:10 VOL-0372
> -rw-r-----+ 1 bacula    disk    386571201 Nov 13 23:11 VOL-0373
> -rw-r-----+ 1 bacula    disk    293973535 Nov 13 23:11 VOL-0374
> -rw-r-----+ 1 bacula    disk   2147475063 Nov 13 23:49 VOL-0375
> -rw-r-----+ 1 bacula    disk   2147475420 Nov 14 00:02 VOL-0376
> -rw-r-----+ 1 bacula    disk   2147475589 Nov 14 00:16 VOL-0377
> -rw-r-----+ 1 bacula    disk   2147475440 Nov 14 00:27 VOL-0378
> -rw-r-----+ 1 bacula    disk   2147475617 Nov 14 00:33 VOL-0379
> -rw-r-----+ 1 bacula    disk   2147475509 Nov 14 00:43 VOL-0380
> -rw-r-----+ 1 bacula    disk   2147475488 Nov 14 00:54 VOL-0381
> -rw-r-----+ 1 bacula    disk   2147475609 Nov 14 01:02 VOL-0382
> -rw-r-----+ 1 bacula    disk   2147475560 Nov 14 01:11 VOL-0383
> -rw-r-----+ 1 bacula    disk   2147475469 Nov 14 01:21 VOL-0384
> -rw-r-----+ 1 bacula    disk   2147475584 Nov 14 01:30 VOL-0385
> -rw-r-----+ 1 bacula    disk   2147475594 Nov 14 01:38 VOL-0386
> -rw-r-----+ 1 bacula    disk   2147475098 Nov 19 09:21 VOL-0387
> -rw-r-----+ 1 bacula    disk    395513973 Nov 24 08:32 VOL-0388
>
> My config is below. If you can see what's wrong please point me in the 
> right direction
> or to a howto to setup this up.
>
> $ rpm -q centos-release
> centos-release-5-3.el5.centos.1
>
> $ uname -a
> Linux mad06.wl0.org 2.6.18-128.7.1.el5 #1 SMP Mon Aug 24 08:21:56 EDT 2009 
> x86_64 x86_64 x86_64 GNU/Linux
>
> $ rpm -qa | grep bacula
> bacula-mysql-3.0.1-1
> bacula-mtx-3.0.1-1
> bacula-gconsole-2.4.2-1
>
> # df -h /bacula/2
> Filesystem            Size  Used Avail Use% Mounted on
> n5200:/raid0/data/backup
>                      2.7T  180G  2.5T   7% /bacula/2
>
> -------------------- bacula-sd.conf ---------------
>
> Storage {                             # definition of myself
>  Name = mad06-sd
>  SDPort = 9103                  # Director's port
>  WorkingDirectory = "/var/lib/bacula"
>  Pid Directory = "/var/run"
>  Maximum Concurrent Jobs = 20
> }
>
> #
> # List Directors who are permitted to contact Storage daemon
> #
> Director {
>  Name = mad06-dir
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
> }
>
> #
> # Restricted Director, used by tray-monitor to get the
> #   status of the storage daemon
> #
> Director {
>  Name = mad06-mon
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>  Monitor = yes
> }
>
> #
> # Devices supported by this Storage daemon
> # To connect, the Director's bacula-dir.conf must have the
> #  same Name and MediaType.
> #
>
> Device {
>  Name           = FileStorage2
>  Media Type     = File
>  Archive Device = /bacula/2
>  LabelMedia     = yes;                   # lets Bacula label unlabeled 
> media
>  Random Access  = Yes;
>  AutomaticMount = yes;               # when device opened, read it
>  RemovableMedia = no;
>  AlwaysOpen     = no;
>  LabelMedia     = yes; # label media automatically
> }
>
> #
> # Send all messages to the Director,
> # mount messages also are sent to the email address
> #
> Messages {
>  Name = Standard
>  director = mad06-dir = all
> }
>
> ---------------- bacula-fd.conf ------------------------
>
> #
> # List Directors who are permitted to contact this File daemon
> #
> Director {
>  Name = mad06-dir
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"          # 
> password for FileDaemon
> }
>
> #
> # Restricted Director, used by tray-monitor to get the
> #   status of the file daemon
> #
> Director {
>  Name = mad06-mon
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>  Monitor = yes
> }
>
> #
> # "Global" File daemon configuration specifications
> #
> FileDaemon {                          # this is me
>  Name = mad06-fd
>  FDport = 9102                  # where we listen for the director
>  WorkingDirectory = /var/lib/bacula
>  Pid Directory = /var/run
>  Maximum Concurrent Jobs = 20
> }
>
> # Send all messages except skipped files back to Director
> Messages {
>  Name = Standard
>  director = mad06-dir = all, !skipped, !restored
> }
>
> ------------------ bacula-dir.conf -------------------------
>
> Director {                            # define myself
>  Name                    = mad06-dir
>  DIRport                 = 9101                # where we listen for UA 
> connections
>  QueryFile               = "/usr/lib64/bacula/query.sql"
>  WorkingDirectory        = "/var/lib/bacula"
>  PidDirectory            = "/var/run"
>  Maximum Concurrent Jobs = 1
>  Password                = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>  Messages                = Daemon
> }
>
> JobDefs {
>  Name     = "JobDefsDefault"
>  Type     = Backup
>  Level    = Incremental
>  Client   = mad06-fd
>  FileSet  = "mad06-Full Set"
>  Schedule = "WeeklyCycle"
>  Storage  = File
>  Messages = Standard
>  Pool     = DISK_POOL
>  Priority = 10
> }
>
> # mad06 backup
> Job {
>  Name                     = "mad06-job"
>  Type                     = Backup
>  Client                   = mad06-fd
>  FileSet                  = "mad06-Full Set"
>  Schedule                 = "WeeklyCycle"
>  Storage                  = File
>  Messages                 = Standard
>  Pool                     = DISK_POOL
>  Full Backup Pool         = DISK_POOL
>  Incremental Backup Pool  = DISK_POOL
>  Differential Backup Pool = DISK_POOL
>  Write Bootstrap          = "/var/lib/bacula/mad06-job.bsr"
>  Priority                 = 10
> }
>
> # Backup the catalog database (after the nightly save)
> Job {
>  Name            = "BackupCatalog"
>  JobDefs         = "JobDefsDefault"
>  Level           = Full
>  FileSet         = "Catalog"
>  Schedule        = "WeeklyCycleAfterBackup"
>  # This creates an ASCII copy of the catalog
>  RunBeforeJob    = "/usr/lib64/bacula/make_catalog_backup bacula bacula 
> XXXXXXXX"
>  # This deletes the copy of the catalog
>  RunAfterJob     = "/usr/lib64/bacula/delete_catalog_backup"
>  Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr"
>  Priority        = 11                   # run after main backup
> }
>
> #
> # Standard Restore template, to be changed by Console program
> #  Only one such job is needed for all Jobs/Clients/Storage ...
> #
> Job {
>  Name     = "RestoreFiles"
>  Type     = Restore
>  Client   = mad06-fd
>  FileSet  = "mad06-Full Set"
>  Storage  = File
>  Pool     = Default
>  Messages = Standard
>  Where    = /bacula-restores
> }
>
> # List of files to be backed up
> FileSet {
>  Name = "mad06-Full Set"
>  Include {
>    Options {
>      signature = MD5
>      compression = GZIP
>    }
>
>    File = /
>    File = /boot
>    File = /boot2
>    File = /export/...
>    File = /export/home
>    File = /export/mirror
>    File = /export/...
>    File = /export/photos
>    File = /export/...
>    File = /home/sjmudd
>    File = /openpkg
>    File = /vmware
>    File = /vmware/...
>    File = /vmware/...
>    File = /vmware/...
>    File = /vmware/...
>  }
>
>  Exclude {
>    File = /proc
>    File = /tmp
>    File = /var/tmp
>    File = /.journal
>    File = /.fsck
>    File = /bacula
>    File = /bacula-restores
>  }
> }
>
> #
> # When to do the backups, full backup on first sunday of the month,
> #  differential (i.e. incremental since full) every other sunday,
> #  and incremental backups other days
> Schedule {
>  Name = "WeeklyCycle"
>  Run  = Level=Full         1st sun at 23:05
>  Run  = Level=Differential 2nd-5th sun at 23:05
> # 2 incrementals a day
>  Run  = Level=Incremental  mon-sat at 23:05
>  Run  = Level=Incremental  mon-sat at 11:05
> }
>
> # This schedule does the catalog. It starts after the WeeklyCycle
> Schedule {
>  Name = "WeeklyCycleAfterBackup"
>  Run  = Level=Full sun-sat at 23:10
> }
>
> # This is the backup of the catalog
> FileSet {
>  Name = "Catalog"
>  Include {
>    Options {
>      signature = MD5
>    }
>    File = /var/lib/bacula/bacula.sql
>  }
> }
>
> # Client (File Services) to backup
> Client {
>  Name           = mad06-fd
>  Address        = mad06
>  FDPort         = 9102
>  Catalog        = MyCatalog
>  Password       = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" 
> # password for FileDaemon
>  File Retention = 20 days            # 30 days
>  Job Retention  = 32 days            # six months
>  AutoPrune      = yes                # Prune expired Jobs/Files
> }
>
> # Definition of file storage device
> Storage {
>  Name = File
>  Address = mad06                # N.B. Use a fully qualified name here
>  SDPort = 9103
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>  Device = FileStorage1
>  Media Type = File
> }
>
> # Generic catalog service
> Catalog {
>  Name = MyCatalog
>  dbname = bacula; user = bacula; password = "XXXXXXXX"
> }
>
> # Reasonable message delivery -- send most everything to email address
> #  and to the console
> Messages {
>  Name = Standard
>
>  mailcommand     = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) 
> \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"
>  operatorcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) 
> \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"
>  mail            = root AT mad06.wl0 DOT org = all, !skipped
>  operator        = root AT mad06.wl0 DOT org = mount
>  console         = all, !skipped, !saved
>
>  append = "/var/lib/bacula/log" = all, !skipped, !saved
> }
>
>
> #
> # Message delivery for daemon messages (no job).
> Messages {
>  Name = Daemon
>  mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s 
> \"Bacula daemon message\" %r"
>  mail        = root AT mad06.wl0 DOT org = all, !skipped
>  console     = all, !skipped, !saved
>  append      = "/var/lib/bacula/log" = all, !skipped
> }
>
> # Default pool definition
> Pool {
>  Name                 = Default
>  Pool Type            = Backup
>  Maximum Volume Bytes = 2G
>  Recycle              = yes
>  AutoPrune            = yes
>  Label Format         = VOL-
>  Maximum Volumes      = 100
> }
>
> ###################################################################################
> #### taken from 
> http://www.bacula.org/en/rel-manual/Automated_Disk_Backup.html
>
> # This is to replace what I did before. I want to have a max of 100x files 
> of
> # 2GB. Thus no explicit expiration. Whatever fits.
> Pool {
>  Name                 = DISK_POOL
>  Pool Type            = Backup
>  Maximum Volume Bytes = 2G
>  Recycle              = yes
>  AutoPrune            = yes
>  Maximum Volume Jobs  = 1
>  Label Format         = VOL-
>  Maximum Volumes      = 100
> }
>
> ###################################################################################
>
> # Scratch pool definition
> Pool {
>  Name = Scratch
>  Pool Type = Backup
> }
>
> #
> # Restricted console used by tray-monitor to get the status of the 
> director
> #
> Console {
>  Name = mad06-mon
>  Password = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
>  CommandACL = status, .status
> }
>
> ------------ -end ------------------
>
> Thanks for any help you can provide,
>
> Simon
>
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing.
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev 



------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users