Jobs
1) Get the stats and the jobs’ names, the names could be used in many other commands!
srvbkp@local # bconsole
Connecting to Director localhost:9101
1000 OK: 1 srvbkp-dir Version: 7.0.5 (28 July 2014)
Enter a period to cancel a command.
*list jobtotals
Automatically selected Catalog: allbackup
Using Catalog "allbackup"
+------+-----------+-------------------+--------------------------------+
| Jobs | Files | Bytes | Job |
+------+-----------+-------------------+--------------------------------+
| 90 | 90 | 123,665,584,337 | BackupCatalog |
| 5 | 5 | 281,593,737,603 | RestoreFiles |
| 13 | 1,232,316 | 118,480,634,434 | srv1-media |
| 32 | 12 | 3,674 | srv1-dns |
| 32 | 10 | 3,064 | srv2-dns |
| 32 | 10 | 3,064 | srv3-dns |
| 32 | 10 | 3,086 | srv4-dns |
| 32 | 10 | 3,084 | srv5-dns |
| 26 | 3,837,536 | 587,812,183,466 | srv1-images |
+------+-----------+-------------------+--------------------------------+
+-------+------------+-------------------+
| Jobs | Files | Bytes |
+-------+------------+-------------------+
| 1,474 | 14,925,321 | 5,475,024,028,957 |
+-------+------------+-------------------+
*
2) Get all configurations for all jobs, here are included only two for clarity. All needed information for taking a backup of a server. You can see the files, which will be included (or excluded), where the backup will be stored when will happen in time, and how many different types of backup will be done – full, incremental, and differential. And this whole information is for all clients (servers).
*show jobs
Job: name=srv1-dns JobType=66 level= Priority=10 Enabled=1
MaxJobs=1 Resched=0 Times=0 Interval=1,800 Spool=0 WritePartAfterJob=1
Accurate=0
--> Client: name=srv1-dns address=192.168.0.100 FDport=9102 MaxJobs=1
JobRetention=1 month FileRetention=1 month AutoPrune=1
--> Catalog: name=allbackup address=localhost DBport=0 db_name=bacula
db_driver=*None* db_user=bacula MutliDBConn=0
--> FileSet: name=bind
O MZ6
N
I /var/lib/named
N
--> Schedule: name=bind
--> Run Level=Full
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=0
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Differential
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=1 2 3 4
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Incremental
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=1 2 3 4 5 6
wom=0 1 2 3 4 5
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Storage: name=bind address=192.168.0.10 SDport=9103 MaxJobs=10
DeviceName=bind MediaType=File StorageId=17
--> Pool: name=Default PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=100 auto_prune=1 VolRetention=1 year
VolUse=0 secs recycle=1 LabelFormat=*None*
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=53687091200
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-full PoolType=Backup
use_cat=1 use_once=1 cat_files=1
max_vols=0 auto_prune=1 VolRetention=2 months
VolUse=0 secs recycle=1 LabelFormat=bind-full
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-incr PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=7 days
VolUse=23 hours recycle=1 LabelFormat=bind-incr
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-diff PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=1 month 1 day
VolUse=0 secs recycle=1 LabelFormat=bind-diff
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Messages: name=Standard
mailcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: %t %e of %c %l" %r
opcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: Intervention needed for %j" %r
Job: name=srv2-dns JobType=66 level= Priority=10 Enabled=1
MaxJobs=1 Resched=0 Times=0 Interval=1,800 Spool=0 WritePartAfterJob=1
Accurate=0
--> Client: name=srv2-dns address=192.168.0.101 FDport=9102 MaxJobs=1
JobRetention=1 month FileRetention=1 month AutoPrune=1
--> Catalog: name=allbackup address=localhost DBport=0 db_name=bacula
db_driver=*None* db_user=bacula MutliDBConn=0
--> FileSet: name=bind
O MZ6
N
I /var/lib/named
N
--> Schedule: name=bind
--> Run Level=Full
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=0
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Differential
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=1 2 3 4
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Incremental
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=1 2 3 4 5 6
wom=0 1 2 3 4 5
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Storage: name=bind address=192.168.0.10 SDport=9103 MaxJobs=10
DeviceName=bind MediaType=File StorageId=17
--> Pool: name=Default PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=100 auto_prune=1 VolRetention=1 year
VolUse=0 secs recycle=1 LabelFormat=*None*
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=53687091200
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-full PoolType=Backup
use_cat=1 use_once=1 cat_files=1
max_vols=0 auto_prune=1 VolRetention=2 months
VolUse=0 secs recycle=1 LabelFormat=bind-full
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-incr PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=7 days
VolUse=23 hours recycle=1 LabelFormat=bind-incr
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-diff PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=1 month 1 day
VolUse=0 secs recycle=1 LabelFormat=bind-diff
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Messages: name=Standard
mailcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: %t %e of %c %l" %r
opcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: Intervention needed for %j" %r
3) You can get the full configuration information of a job (the information is the same as above, but for a given job name, which could be taken from the first command above, it is not necessary to output all the configurations every time):
srvbkp@local # bconsole
Connecting to Director localhost:9101
1000 OK: 1 srvbkp-dir Version: 7.0.5 (28 July 2014)
Enter a period to cancel a command.
*show jobs=srv2-dns
Job: name=srv2-dns JobType=66 level= Priority=10 Enabled=1
MaxJobs=1 Resched=0 Times=0 Interval=1,800 Spool=0 WritePartAfterJob=1
Accurate=0
--> Client: name=srv2-dns address=192.168.0.101 FDport=9102 MaxJobs=1
JobRetention=1 month FileRetention=1 month AutoPrune=1
--> Catalog: name=allbackup address=localhost DBport=0 db_name=bacula
db_driver=*None* db_user=bacula MutliDBConn=0
--> FileSet: name=bind
O MZ6
N
I /var/lib/named
N
--> Schedule: name=bind
--> Run Level=Full
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=0
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Differential
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=0
wom=1 2 3 4
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Run Level=Incremental
hour=20
mday=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
month=0 1 2 3 4 5 6 7 8 9 10 11
wday=1 2 3 4 5 6
wom=0 1 2 3 4 5
woy=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
mins=0
--> Storage: name=bind address=192.168.0.10 SDport=9103 MaxJobs=10
DeviceName=bind MediaType=File StorageId=17
--> Pool: name=Default PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=100 auto_prune=1 VolRetention=1 year
VolUse=0 secs recycle=1 LabelFormat=*None*
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=53687091200
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-full PoolType=Backup
use_cat=1 use_once=1 cat_files=1
max_vols=0 auto_prune=1 VolRetention=2 months
VolUse=0 secs recycle=1 LabelFormat=bind-full
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-incr PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=7 days
VolUse=23 hours recycle=1 LabelFormat=bind-incr
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Pool: name=bind-diff PoolType=Backup
use_cat=1 use_once=0 cat_files=1
max_vols=0 auto_prune=1 VolRetention=1 month 1 day
VolUse=0 secs recycle=1 LabelFormat=bind-diff
CleaningPrefix=*None* LabelType=0
RecyleOldest=0 PurgeOldest=0 ActionOnPurge=0
MaxVolJobs=0 MaxVolFiles=0 MaxVolBytes=0
MigTime=0 secs MigHiBytes=0 MigLoBytes=0
JobRetention=0 secs FileRetention=0 secs
--> Messages: name=Standard
mailcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: %t %e of %c %l" %r
opcmd=/usr/sbin/bsmtp -h localhost -f "(Bacula) <%r>" -s "Bacula: Intervention needed for %j" %r
4) Lists all jobs’ status – ID, StartTime, Type (backup?), Level (Full, increment, differential?), Files and bytes processed and the status of the job (Terminated normally, Running,Fatal error and so on). Found out if you have backups of a server or the backup process failed!
srvbkp@local # bconsole
Connecting to Director localhost:9101
1000 OK: 1 srvbkp-dir Version: 7.0.5 (28 July 2014)
Enter a period to cancel a command.
*list jobs
+-------+--------------------------------+---------------------+------+-------+-----------+-----------------+-----------+
| JobId | Name | StartTime | Type | Level | JobFiles | JobBytes | JobStatus |
+-------+--------------------------------+---------------------+------+-------+-----------+-----------------+-----------+
| 128 | srv1-test | 2016-12-04 23:05:00 | B | F | 17,506 | 52,116,400 | T |
| 178 | srv1-test | 2016-12-09 23:05:01 | B | I | 13 | 1,509 | T |
| 188 | srv1-test | 2016-12-10 23:05:01 | B | I | 13 | 1,509 | T |
.........................................................................................................................
| 8,927 | srv2-images | 2018-03-04 20:00:00 | B | F | 0 | 0 | f |
| 8,928 | srv1-media | 2018-03-04 20:00:00 | B | F | 3 | 978 | T |
| 8,930 | srv1-dns | 2018-03-04 20:00:01 | B | F | 6 | 1,843 | T |
| 8,932 | srv2-dns | 2018-03-04 20:00:01 | B | F | 6 | 1,837 | T |
| 8,931 | srv3-dns | 2018-03-04 20:00:03 | B | F | 5 | 1,542 | T |
| 8,933 | srv4-dns | 2018-03-04 20:00:04 | B | F | 4 | 1,258 | T |
| 8,934 | srv5-dns | 2018-03-04 20:00:04 | B | F | 4 | 1,258 | T |
+-------+--------------------------------+---------------------+------+-------+-----------+-----------------+-----------+
5) Which files were included in a backup job? Lists all paths and files included in the backup job (the ID is from the above command):
*list files jobid=8934
+----------+
| Filename |
+----------+
| /var/lib/named/ |
| /var/lib/named/root.cache |
| /var/lib/named/sec |
| /var/lib/named/sec/example.com.db |
| /var/lib/named/sec/example2.net.db |
| /var/lib/named/pri |
+----------+
+-------+----------+---------------------+------+-------+----------+----------+-----------+
| JobId | Name | StartTime | Type | Level | JobFiles | JobBytes | JobStatus |
+-------+----------+---------------------+------+-------+----------+----------+-----------+
| 8,934 | srv5-dns | 2018-03-04 20:00:20 | B | F | 6 | 1,851 | T |
+-------+----------+---------------------+------+-------+----------+----------+-----------+
6) Get the scheduled jobs. Which jobs will be executed and when:
*status dir
Scheduled Jobs:
Level Type Pri Scheduled Job Name Volume
===================================================================================
Incremental Backup 10 06-Mar-18 20:00 srv1-dns *unknown*
Incremental Backup 10 06-Mar-18 20:00 srv2-dns *unknown*
Incremental Backup 10 06-Mar-18 20:00 srv3-dns *unknown*
Incremental Backup 10 06-Mar-18 20:00 srv4-dns *unknown*
Incremental Backup 10 06-Mar-18 20:00 srv5-dns *unknown*
...................................................................................
Incremental Backup 10 06-Mar-18 23:05 srv1-media *unknown*
Full Backup 10 06-Mar-18 23:05 srv1-images *unknown*
====
Running Jobs:
Console connected at 06-Mar-18 13:36
No Jobs running.
====
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
====================================================================
9006 Incr 472 296.8 M OK 05-Mar-18 23:05 srv1-dns
9007 Incr 10,547 194.8 M Error 05-Mar-18 23:05 srv2-dns
9002 Incr 37 133.0 M OK 05-Mar-18 23:05 srv3-dns
8995 Incr 57 372.2 M OK 05-Mar-18 23:06 srv4-dns
9000 Incr 391 1.195 G OK 05-Mar-18 23:07 srv5-dns
9008 Full 832 7.139 G OK 05-Mar-18 23:49 srv1-images
9009 Full 1 1.493 G OK 05-Mar-18 23:50 srv1-media
9011 Full 315,027 121.6 G OK 06-Mar-18 03:44 srv2-images
9012 Full 314,804 93.85 G OK 06-Mar-18 04:18 srv2-media
====
*
Where are the backup files on your system? Trace the bacula media devices to the real path of your backup files.