SearchFAQMemberlist Log in
Reply to topic Page 1 of 1
Run scripts fails
Author Message
Post Run scripts fails 
Hi,
The command is not launched w/o error in the log. My config file:

Job {
Name = "BackupDagobah"
JobDefs = "SA1Job"
FileSet = "Wordpress Set"
Client = dagobah-fd
RunScript {
Command = "/usr/bin/mysqldump --user=wordpress --password=XXX
wordpress > /srv/wordpress/db/wordpress.sql"
RunsWhen = Before
}

But the director display something when it parses the config file:

$ sudo /usr/sbin/bacula-dir -f -d -c /etc/bacula/bacula-dir.conf -t
bacula-dir: dird_conf.c:1860-0 runscript cmd="/usr/bin/mysqldump
--user=wordpress --password=XXX wordpress >
/srv/wordpress/db/wordpress.sql" type=|


Any ideas?


--
Sebastien Douche <sdouche < at > gmail.com>
Twitter: < at > sdouche / G+: +sdouche

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Post Run scripts fails 
On Tue, 27 Dec 2011 14:55:48 +0100
Sebastien Douche <sdouche < at > gmail.com> wrote:

Hi,
The command is not launched w/o error in the log. My config file:

Job {
Name = "BackupDagobah"
JobDefs = "SA1Job"
FileSet = "Wordpress Set"
Client = dagobah-fd
RunScript {
Command = "/usr/bin/mysqldump --user=wordpress --password=XXX
wordpress > /srv/wordpress/db/wordpress.sql"
RunsWhen = Before
}

But the director display something when it parses the config file:

$ sudo /usr/sbin/bacula-dir -f -d -c /etc/bacula/bacula-dir.conf -t
bacula-dir: dird_conf.c:1860-0 runscript cmd="/usr/bin/mysqldump
--user=wordpress --password=XXX wordpress >
/srv/wordpress/db/wordpress.sql" type=|

Any ideas?
I suspect the problem is that running an internal command does not have
shell semantics, or, to put differently, the call does not go through
the shell.

What that means, is when you run
cmd >file
from within a shell (or in a shell script, which is essentially the
same) the shell opens the file "file" and then runs the "cmd" command
with its stdout redirected to the file descriptor assotiated with that
opened file; after the command exits, the shell closes the file.

But bacula just calls something like execv(2) on your arguments,
so your mysqldump binary gets those ">" and "/srv/...." arguments
literally and has no idea what to do with them.

So either use something like

Command = "/bin/sh -c '/usr/bin/mysqldump --user=wordpress --password=XXX wordpress > /srv/wordpress/db/wordpress.sql'"

or create a shell script and specify its name.

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Bacula-users mailing list
Bacula-users < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Magic SEO URL for phpBB