On 01/09/14 15:45, Shadow187 wrote:

You can used a (simple) one-liner like this:


echo "SELECT * FROM Media;" \
  | mysql -u bacula bacula  \
  | sed -e 's/\(^.\)/"\1/'  \
    -e 's/\t/","/g'         \
    -e 's/\(.$\)/\1"/' > /tmp/media.csv

That will output all of your media (all columns of the Media table) into a
file '/tmp/media.csv' as a double-quoted, comma-delimited list that should be
readily imported into Excel.

Also, you may not care about several of the columns returned (e.g.:
ScratchPoolId, InChanger, DeviceId etc) so you can choose/limit the columns
you want by changing the * in the SELECT statement to a comma separated list
of the columns you do want like so:

SELECT MediaId, VolumeName, VolStatus, VolErrors FROM Media....

Hope this helps.

-- 
Bill Arlofski
Reverse Polarity, LLC
http://www.revpol.com/
-- Not responsible for anything below this line --

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to