[Continuation]
Configurations are below, and nothing really has changed since upgrading
from 9.4.2 to 13.0.4.
The upgrade was done via in-place upgrades of the backup server from
Ubuntu 20.04 -> 22.04 -> 24.04. The first upgrade removed bacula
entirely (since bacula was dropped from the jammy repositories), but
left the configs around (packages in "rc" state), and I upgraded
postgres 12 to 14. I then upgraded to 24.04, upgraded postgres 14 to 16,
and re-installed bacula. Finally, I used the database script:
//usr/share/bacula-director/update_postgresql_tables/
to migrate the database contents, with the small "|tail -n +4|" tweak,
and updated the owner of the tables, thanks to these blog posts:
https://dan.langille.org/2023/11/23/bacula-moving-from-9-x-to-13-x-and-upgrading-the-postgresql-database/
https://www.bostoncube.com/tech-life/bacula-pi/240912-cutover
Anyway, any clues gratefully received. Many thanks for taking the
trouble to read this.
Regards,
Brian.
P.S. I did also find an instance in /var/log/bacula/bacula.log where two
logs seems to have blatted on each other:
26-Jan 05:09 store.nsrc.org-dir JobId 92925: Error: sql_create.c:430
Volume "92925-director.nsrc.org-fd-Full-Full-2025-01-26" already exists.
26-Jan 05:14 store.nsrc.org-dir JobId 92925: Error: sql_create.c:430
Volume "92925-director.nsrc.org-fd-Full-Full-2025-01-26" already exists.
26-Jan 05:19 store.nsrc.org-dir JobId 92925: Error:26-Jan 04:06
store.nsrc.org-dir JobId 92941: Start Backup JobId 92941,
Job=photos0.nsrc.org.2025-01-25_21.00.00_50
sql_create.c:430 Volume
"92925-director.nsrc.org-fd-Full-Full-2025-01-26" already exists.
26-Jan 05:24 store.nsrc.org-dir JobId 92925: Error: sql_create.c:430
Volume "92925-director.nsrc.org-fd-Full-Full-2025-01-26" already exists.
26-Jan 05:29 store.nsrc.org-dir JobId 92925: Error: sql_create.c:430
Volume "92925-director.nsrc.org-fd-Full-Full-2025-01-26" already exists.
Note on the third line shown, where a new log line "26-Jan 04:06..."
starts midway through another log line. This is *probably* not related
but I thought it was worth a mention. The implication is that two
processes or threads are writing to the same log file without coordination.
----- Here are the configs, with minor trimming (comment removal,
password and email hiding) -----
*==> bacula-dir.conf <==*
Director { # define myself
Name = store.nsrc.org-dir
DIRport = 9101 # where we listen for UA connections
QueryFile = "/etc/bacula/scripts/query.sql"
WorkingDirectory = "/var/lib/bacula"
PidDirectory = "/run/bacula"
Maximum Concurrent Jobs = 2 # Adjust this to # of storage devices
Password = "XXXX"
Messages = Daemon
}
@/etc/bacula/bacula-jobs.conf
@/etc/bacula/bacula-filesets.conf
@/etc/bacula/bacula-clients.conf
@/etc/bacula/bacula-pools.conf
@/etc/bacula/bacula-schedules.conf
# This schedule does the catalog. It starts after the WeeklyCycle
Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full sun at 23:30
}
# This is the backup of the catalog
FileSet {
Name = "Catalog"
Include {
Options {
signature = MD5
}
File = "/var/lib/bacula/bacula.sql"
}
}
@/etc/bacula/bacula-storage.conf
# Generic catalog service
Catalog {
Name = NSRCCatalog
dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}
Messages {
Name = Standard
mailcommand = "/usr/sbin/bsmtp -h localhost -f x...@example.com -s
\"Bacula-NSRC: %t %e of %c %l\" %r"
operatorcommand = "/usr/sbin/bsmtp -h localhost -f x...@example.com -s
\"Bacula-NSRC: Intervention needed for %j\" %r"
mail = y...@example.com = all, !skipped
operator = y...@example.com = mount
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
catalog = error, fatal, terminate, notsaved
}
Messages {
Name = Daemon
mailcommand = "/usr/sbin/bsmtp -h localhost -f x...@example.com -s
\"Bacula-NSRC daemon message\" %r"
mail = y...@example.com = all, !skipped
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
catalog = error, fatal, terminate, notsaved
}
*==> bacula-jobs.conf <==*
JobDefs {
Name = "DefaultJob"
Type = Backup
Level = Incremental
Schedule = "FullNoDiff" # Can be overridden by
client
FileSet = "Full Set"
Client = store.nsrc.org-fd
Storage = FileStorage0,FileStorage1
Messages = Standard
Priority = 10
Write Bootstrap = "/var/lib/bacula/%c.bsr"
SpoolData = no
Pool = Full
Full Backup Pool = Full
# Differential Backup Pool = Diff # No differential backups
Incremental Backup Pool = Incr
}
# Backup the catalog database (after the nightly save)
Job {
Name = "BackupCatalog"
JobDefs = "DefaultJob"
Level = Full
FileSet="Catalog"
Schedule = "WeeklyCycleAfterBackup"
# This creates an ASCII copy of the catalog
# Arguments to make_catalog_backup.pl are:
# make_catalog_backup.pl <catalog-name>
RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl NSRCCatalog"
# This deletes the copy of the catalog
RunAfterJob = "/etc/bacula/scripts/delete_catalog_backup"
Write Bootstrap = "/var/lib/bacula/%n.bsr"
Priority = 11 # run after main backup
}
...
Job {
Name = "director.nsrc.org"
Client = director.nsrc.org-fd
FileSet = "Full Set"
JobDefs = "DefaultJob"
}
Job {
Name = "drupal.nsrc.org"
Client = drupal.nsrc.org-fd
FileSet = "Full Set"
JobDefs = "DefaultJob"
}
...
#
# 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= store.nsrc.org-fd
# The FileSet and Pool directives are not used by Restore Jobs
# but must not be removed
Pool = Full
FileSet="Full Set"
Storage = FileStorage0
Messages = Standard
Where = /backup/restore
}
*==> bacula-filesets.conf <==*
...
# List of files to be backed up
FileSet {
Name = "Full Set"
Enable VSS = yes
Ignore FileSet Changes = no # Always do a full backup if you change
the fileset
Include {
Options {
onefs = no
compression = GZIP
signature = MD5
sparse = yes
}
File = /
Exclude Dir Containing = .nobackup
}
Exclude {
File = /var/lib/bacula
File = /var/lib/lxcfs
File = /dev
File = /proc
File = /tmp
File = /sys
File = /nfs
File = /space
File = /.journal
File = /.fsck
File = /.snap
}
}
...
*==> bacula-clients.conf <==*
...
Client {
Name = director.nsrc.org-fd
Address = director.nsrc.org
FDPort = 9102
Catalog = NSRCCatalog
Password = "XXXX"
File Retention = 1 year # 1 year
Job Retention = 1 year # 1 year
AutoPrune = yes # Prune expired Jobs/Files
}
Client {
Name = drupal.nsrc.org-fd
Address = drupal.nsrc.org
FDPort = 9102
Catalog = NSRCCatalog
Password = "XXXX"
File Retention = 1 year # 1 year
Job Retention = 1 year # 1 year
AutoPrune = yes # Prune expired Jobs/Files
}
...
*==> bacula-pools.conf <==*
Pool {
Name = Full
Pool Type = Backup
Recycle = no
Use Volume Once = yes
# Recycle Oldest Volume = yes # Don't recycle "tapes"
AutoPrune = yes
# Action On Purge = Truncate # TO BE TESTED
Volume Retention = 6 months # Keep intermediate Full
backups 17 days
# Volume Use Duration = 160h # Doesn't apply to disk-tapes
Maximum Volume Jobs = 1 # Never reuse
Storage = FileStorage0,FileStorage1
LabelFormat =
"${JobId}-${Client}-${Level}-${Pool}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}"
}
Pool {
Name = Incr
Pool Type = Backup
Recycle = no
Use Volume Once = yes
# Recycle Oldest Volume = yes
AutoPrune = yes
# Action On Purge = Truncate
Volume Retention = 6 months
# Volume Use Duration = 12h
Maximum Volume Jobs = 1
Storage = FileStorage0,FileStorage1
LabelFormat =
"${JobId}-${Client}-${Level}-${Pool}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}"
}
Pool {
Name = FullMonth
Pool Type = Backup
Recycle = no
Use Volume Once = yes
AutoPrune = no
Volume Retention = 6 months
# Volume Use Duration = 60h
Maximum Volume Jobs = 1
Storage = FileStorage0,FileStorage1
LabelFormat =
"${JobId}-${Client}-${Level}-${Pool}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}"
}
# Default pool definition
Pool {
Name = Default
Pool Type = Backup
Recycle = yes # Bacula can automatically
recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
Maximum Volume Jobs = 1 # One diskfile / backup
Storage = FileStorage0,FileStorage1
LabelFormat =
"${JobId}-${Job}-${Client}-${Level}-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}"
}
*==> bacula-schedules.conf <==*
Schedule {
Name = "FullNoDiff"
Run = Level=Incremental Pool=Incr mon-fri at 22:30
Run = Level=Full Pool=FullMonth 1st sat at 21:00
Run = Level=Full Pool=Full 2nd-3rd sat at 21:00
Run = Level=Full Pool=Full 4th-5th sat at 21:00
}
Schedule {
Name = "Never"
}
*==> bacula-storage.conf <==*
Storage {
Name = FileStorage0
Address = store.nsrc.org # N.B. Use a fully qualified
name here
SDPort = 9103
Password = "XXXX"
Device = FileDev0
Media Type = File0
Maximum Concurrent Jobs = 4
}
Storage {
Name = FileStorage1
Address = store.nsrc.org # N.B. Use a fully qualified
name here
SDPort = 9103
Password = "XXXX"
Device = FileDev1
Media Type = File1
Maximum Concurrent Jobs = 4
}
*==> bacula-sd.conf <==*
Storage { # definition of myself
Name = store.nsrc.org-sd
SDPort = 9103 # Director's port
WorkingDirectory = "/var/lib/bacula"
Pid Directory = "/run/bacula"
Maximum Concurrent Jobs = 20 # Adjust if needed...
Heartbeat Interval = 60
}
#
# List Directors who are permitted to contact Storage daemon
#
Director {
Name = store.nsrc.org-dir
Password = "XXXX"
}
Device {
Name = FileDev0
Media Type = File0
Archive Device = /backup/bacula
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
Device {
Name = FileDev1
Media Type = File1
Archive Device = /backup/bacula
LabelMedia = yes; # lets Bacula label unlabeled media
Random Access = Yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
}
#
# Send all messages to the Director,
# mount messages also are sent to the email address
#
Messages {
Name = Standard
director = store.nsrc.org-dir = all
}
*==> bacula-fd.conf <==*
Director {
Name = store.nsrc.org-dir
Password = "XXXX"
}
FileDaemon { # this is me
Name = store.nsrc.org-fd
FDport = 9102 # where we listen for the director
WorkingDirectory = /var/lib/bacula
Pid Directory = /run/bacula
Maximum Concurrent Jobs = 20
}
# Send all messages except skipped files back to Director
Messages {
Name = Standard
director = store.nsrc.org-dir = all, !skipped, !restored, !verified,
!saved
}
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users