I configured this way on /etc/bareos/bareos-dir.d/job/server.conf

Job {
  Name = "server-job"
  Client = server-fd
  Type = Backup
  Level = Incremental
  FileSet = "server-fs"
  Schedule = "schedule"
  Storage = server-sd
  Messages = Standard
  Pool = pool-server
  Priority = 10
  Write Bootstrap = "/var/lib/bareos/%c.bsr"
  Client Run Before Job = /root/pre_backup.sh
  Client Run After Job = /root/pre_backup.sh
}

The script is located in the client side. It is giving me the following 
errors: 

server-fd JobId 3954: shell command: run ClientBeforeJob 
"/root/pre_backup.sh"
server-fd JobId 3954: ClientBeforeJob: the input device is not a TTY
server-fd JobId 3954: Error: Runscript: ClientBeforeJob returned non-zero 
status=1. ERR=Child exited with code 1
bareos-dir JobId 3954: Start Backup JobId 3954, 
Job=server-job.2020-03-09_14.56.25_04
bareos-dir JobId 3954: Using Device "server-sd" to write.
bareos-dir JobId 3954: Fatal error: Bad response to RunBeforeNow command: 
wanted 2000 OK RunBeforeNow, got 2905 Failed RunScript
bareos-dir JobId 3954: Fatal error: Client "server-fd" RunScript failed

segunda-feira, 9 de Março de 2020 às 12:26:02 UTC, Andrei Brezan escreveu:
>
> Just look at the documentation: 
> https://docs.bareos.org/Configuration/Director.html#job-resource
> You can have Client Run Before Job and Client Run After Job.
>
> --
> Andrei
>
> On Monday, 9 March 2020 13:19:31 UTC+1, Goncalo Sousa wrote:
>>
>> And how do I set to execute the script on the client? 
>>
>> For example: The script is located on the client and I want to execute it 
>> from it?
>>
>> sexta-feira, 6 de Março de 2020 às 16:32:46 UTC, Andrei Brezan escreveu:
>>>
>>> You need to put the script as the value:
>>>
>>> RunBeforeJob="/path/to/my/script"
>>>
>>> On Friday, 6 March 2020 16:52:26 UTC+1, Goncalo Sousa wrote:
>>>>
>>>> So as far as I know I add the option: RunAfterJob=yes and 
>>>> RunBeforeJob=yes in bareos-dir.d/job but how do I call the script?
>>>>
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bareos-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bareos-users/d17e083e-ae37-4dce-881c-ddeefdb43c0a%40googlegroups.com.

Reply via email to