resending to list, too ---------------------- On 2007.11.14. 16:13, Vladimirs Vecgailis wrote: > Hi all! > > Following question - is it possible to run multiple commands with RunScript > on client side? > > I.e. > > ---------------------------- > RunScript { > RunsWhen = Before > FailJobOnError = Yes > Command = "/etc/init.d/someservice stop; lvcreate -s -n > myservicebackup /dev/mylv/servicelv; /etc/init.d/someservice start"
i would suggest using a script (i was doing that in a very similar scenario). script would also take care of any errors and could return nicely desired code for bacula to decide whether backup should proceed or not. it would also make sure that, if snapshot creation fails, service is started again (which might not happen in the second configuration). obviously, don't forget runafter job which removes the snapshot (unless for some reason it will be kept) > RunsOnClient = yes > } > ---------------------------- > > I tested such Definition, but only the first commans was executed - > "someservice stop". > All other have been ignored (?). > > What i done now is, i defined multiple RunScript-Definitions and arranged > them in the order i need: > > ---------------------------- > RunScript { > RunsWhen = Before > FailJobOnError = Yes > Command = "/etc/init.d/someservice stop" > RunsOnClient = yes > } > RunScript { > RunsWhen = Before > FailJobOnError = Yes > Command = "lvcreate -s -n myservicebackup /dev/mylv/servicelv" > RunsOnClient = yes > } > RunScript { > RunsWhen = Before > FailJobOnError = Yes > Command = "/etc/init.d/someservice start" > RunsOnClient = yes > } > ---------------------------- > > > 1. Question - is it possible to define multiple commands? > 2. Question - is such "hack" - definition of multiple RunScripts ok? ... -- Rich ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users