Gregory Brauer wrote:


Is it possible to get the results of a status command to stdout
from a command line command?  I'm looking for something like:

bconsole -c "status client=foo-fd"

Sure.

cartman# echo "status client=cartman-fd" | bconsole
Connecting to Director cartman:9101
1000 OK: cartman-dir Version: 1.36.3 (22 April 2005)
Enter a period to cancel a command.
status client=cartman-fd
Using default Catalog name=MyCatalog DB=bacula
Connecting to Client cartman-fd at cartman.synetsystems.com:9102

cartman-fd Version: 1.36.3 (22 April 2005) i386-portbld-freebsd4.10 freebsd 4.10-RELEASE
Daemon started 15-Jul-05 23:23, 6 Jobs run since started.

Terminated Jobs:
JobId  Level     Files         Bytes  Status   Finished        Name
======================================================================
 8084  Sinc      2,082    273,988,674 OK       14-Jul-05 05:04 cartman-job
8088 Full 1 1,849,703,939 OK 14-Jul-05 05:31 BackupCatalog
 8104  Sinc      1,235    258,555,251 OK       15-Jul-05 04:44 cartman-job
8108 Full 1 1,851,380,661 OK 15-Jul-05 05:12 BackupCatalog
 8123  Sinc      1,191    258,531,386 OK       16-Jul-05 01:00 cartman-job
8127 Full 1 1,852,992,896 OK 16-Jul-05 01:27 BackupCatalog
 8142  Full     53,112  1,291,207,198 OK       17-Jul-05 06:46 cartman-job
8146 Full 1 1,963,428,213 OK 17-Jul-05 08:39 BackupCatalog
 8161  Sinc      1,130    294,858,278 OK       18-Jul-05 01:14 cartman-job
8165 Full 1 1,964,382,613 OK 18-Jul-05 01:45 BackupCatalog
====
Running Jobs:
Director connected at: 18-Jul-05 20:18
No Jobs running.
====
You have messages.
cartman#
You can do more complicated things using the shell "here-doc" syntax, like:

#!/bin/sh

echo "Unmounting tape.."
/usr/local/sbin/bconsole<<END
unmount sdt9000
messages
END

echo "Ejecting tape.."
mt offline

echo "Insert new tape and press enter to continue."
read junk
echo "Waiting 30 seconds for tape drive to settle.."
sleep 30

echo "Mounting tape.."
/usr/local/sbin/bconsole<<END
mount sdt9000
END


Brian


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to