Bacula-users

Re: [Bacula-users] relative order of scripts vs files

2016-04-13 15:28:13
Subject: Re: [Bacula-users] relative order of scripts vs files
From: Heitor Faria <heitor AT bacula.com DOT br>
To: Lloyd Brown <lloyd_brown AT byu DOT edu>
Date: Wed, 13 Apr 2016 16:27:06 -0300 (BRT)
> Unfortunately, there's some sensitive info in the script.  I'll see if I
> can post an excerpt later.
> 
> But here's what I've observed:
> - When the file doesn't exist, I get the error as described.  I've even
> attached to the bacula-fd using strace, and verified that it does try to
> open() that file, but I don't see it trying to execute the script
> - When I touch the file, to create a zero-length placholder, and then
> run the job, it successfully runs the script, which populates the file
> with the list, but the job backs up 0 bytes and 0 files
> - Subsequent runs of the same job, correctly get the file list.
> 
> All of that led me to the conclusion that the file open() is occurring
> before the script.  Also that the script is updating the file correctly.
> 
> Are you sure that your catalog backup is using the "Client Run Before
> Job", and not just a "Run Before Job"?  It is at least possible that the
> Client vs Server versions of the Run Before Job act slightly
> differently.  I haven't examined the source code, though, so this is
> just speculation on my part.
> 
> Lloyd

Hello, Lloyd. I don't think so. Unfortunattely I'm unable to reproduce the 
problem using 7.4.0 Bacula (16 January 2016) x86_64-unknown-linux-gnu ubuntu 
15.10):

# bacula-dir.conf:
Job {
  Name = "BackupClient1"
  JobDefs = "DefaultJob"
  ClientRunBeforeJob = "touch /tmp/dummy"
  ClientRunAfterJob = "rm /tmp/dummy"
}

FileSet {
  Name = "Full Set"
  Include {
    Options {
      signature = MD5
    }
    File = /tmp/dummy
  }
}

# Output of bconsole job run:

13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Iniciar Jobld Backup 5, 
Trabalho=BackupClient1.2016-04-13_16.18.53_09
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Using Device "FileChgr1-Dev1" to write.
13-Abr 16:18 hfaria-desk-i5-fd JobId 5: shell command: run ClientRunBeforeJob 
"touch /tmp/dummy"
13-Abr 16:18 hfaria-desk-i5-sd JobId 5: Volume "Vol-0001" gravado previamente, 
movendo para o fim dos dados.
13-Abr 16:18 hfaria-desk-i5-sd JobId 5: Pronto para anexar no fim do Volume 
"Vol-0001" tamanho=46,326,801
13-Abr 16:18 hfaria-desk-i5-fd JobId 5: shell command: run ClientAfterJob "rm 
/tmp/dummy"
13-Abr 16:18 hfaria-desk-i5-sd JobId 5: Elapsed time=00:00:01, Transfer rate=90 
 Bytes/second
13-Abr 16:18 hfaria-desk-i5-sd JobId 5: Enviando atributos reservados para o 
Diretor. Despooling 264 bytes ...
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Bacula hfaria-desk-i5-dir 7.4.0 
(16Jan16):
  Build OS:               x86_64-unknown-linux-gnu ubuntu 15.10
  JobId:                  5
  Job:                    BackupClient1.2016-04-13_16.18.53_09
  Backup Level:           Full (atualizado de Incremental)
  Client:                 "hfaria-desk-i5-fd" 7.4.0 (16Jan16) 
x86_64-unknown-linux-gnu,ubuntu,15.10
  FileSet:                "Full Set" 2016-04-13 16:17:59
  Pool:                   "File" (From Recurso do Trabalho)
  Catalog:                "MyCatalog" (From Client resource)
  Storage:                "File1" (From Recurso do Trabalho)
  Scheduled time:         13-Abr-2016 16:18:53
  Start time:             13-Abr-2016 16:18:56
  End time:               13-Abr-2016 16:18:56
  Elapsed time:           0 secs
  Priority:               10
  FD Files Written:       1
  SD Files Written:       1
  FD Bytes Written:       0 (0 B)
  SD Bytes Written:       90 (90 B)
  Rate:                   0.0 KB/s
  Software Compression:   None
  Snapshot/VSS:           não
  Encryption:             não
  Accurate:               não
  Volume name(s):         Vol-0001
  Volume Session Id:      3
  Volume Session Time:    1460466241
  Last Volume Bytes:      46,327,331 (46.32 MB)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK

13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Begin pruning Jobs older than 6 months 
.
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Não foram encontrados Jobs para 
compressão.
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Inicia a compressão dos arquivos.
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Nenhum arquivo encontrado para 
comprimir.
13-Abr 16:18 hfaria-desk-i5-dir JobId 5: Fim da auto compressão.

*list files jobid=5
Usando Catálogo "MyCatalog"
+----------+
| Filename |
+----------+
| /tmp/dummy |
+----------+
+-------+---------------+---------------------+------+-------+----------+----------+-----------+
| JobId | Name          | StartTime           | Type | Level | JobFiles | 
JobBytes | JobStatus |
+-------+---------------+---------------------+------+-------+----------+----------+-----------+
|     5 | BackupClient1 | 2016-04-13 16:18:56 | B    | F     |        1 |       
 0 | T         |
+-------+---------------+---------------------+------+-------+----------+----------+-----------+

Regards,
-- 
=========================================================================== 
Heitor Medrado de Faria - LPIC-III | ITIL-F | Bacula Systems Certified 
Administrator II 
Do you need Bacula training? http://bacula.us/video-classes/ 
+55 61 8268-4220 
Site: http://bacula.us FB: heitor.faria 
===========================================================================

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users