Re: [Bacula-users] List files in a volume

2015-04-23 Thread Ana Emília M . Arruda
Much more simple. I thought the script for a huge number of jobs and files.

Thank you.

Best regards,
Ana



On Thu, Apr 23, 2015 at 5:07 AM, Radosław Korzeniewski 
rados...@korzeniewski.net wrote:

 Hello,

 2015-04-22 18:07 GMT+02:00 bdam bacula-fo...@backupcentral.com:

 One final question about this - when i issue the query command from the
 console this way, is there a way to either pagenate the results or send
 them to a file


 Use @output filename.txt in the bconsole to redirect all the output to the
 file. Then simple @output in the bconsole to switch output to screen. You
 can use a @tee command to make an output to the file and scrren in the same
 time.

 best regards
 --
 Radosław Korzeniewski
 rados...@korzeniewski.net


 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users


--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] List files in a volume

2015-04-23 Thread Radosław Korzeniewski
Hello,

2015-04-22 18:07 GMT+02:00 bdam bacula-fo...@backupcentral.com:

 One final question about this - when i issue the query command from the
 console this way, is there a way to either pagenate the results or send
 them to a file


Use @output filename.txt in the bconsole to redirect all the output to the
file. Then simple @output in the bconsole to switch output to screen. You
can use a @tee command to make an output to the file and scrren in the same
time.

best regards
-- 
Radosław Korzeniewski
rados...@korzeniewski.net
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] List files in a volume

2015-04-22 Thread bdam
One final question about this - when i issue the query command from the console 
this way, is there a way to either pagenate the results or send them to a file 
so I can browse them? These are 3 months of CCTV from multiple cameras running 
24/7 in 20 minute sections, so there are rather a lot of files shown!!!

+--
|This was sent by bill.dam...@yahoo.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] List files in a volume

2015-04-22 Thread bdam
I never realized you could copy the sample SQL commands that way. So I did 
that, found the job id's from 14 then the listing from 12. Excellent, 
thanks!

+--
|This was sent by bill.dam...@yahoo.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] List files in a volume

2015-04-22 Thread Ana Emília M . Arruda
Hi,

Maybe something like this:

#!/bin/bash

VOLUME=$1
DBHOST=localhost
DATABASE=bacula
USER=
PASSWORD=

JOBS=($(mysql --host=$DBHOST --database=$DATABASE --user=$USER
--password=$PASSWORD -N -e SELECT DISTINCT Job.JobId as JobId,Job.Name as
Name,Job.StartTime as StartTime, Job.Type as Type,Job.Level as
Level,Job.JobFiles as Files, Job.JobBytes as Bytes,Job.JobStatus as Status
FROM Media,JobMedia,Job WHERE Media.VolumeName=\$VOLUME\ AND
Media.MediaId=JobMedia.MediaId AND JobMedia.JobId=Job.JobId ORDER by
Job.StartTime))
COLS=9
NUMJOBS=$((${#JOBS[*]}/COLS))

printf Jobs for volume %s\n $VOLUME  test.txt

for ((i=0;iNUMJOBS;i++)) do
  printf %s %s %s %s %s %s %s %s %s\n ${JOBS[i*COLS]} ${JOBS[i*COLS+1]}
 ${JOBS[i*COLS+2]} ${JOBS[i*COLS+3]} ${JOBS[i*COLS+4]} ${JOBS[i*COLS+5]}
${JOBS[i*COLS+6]} ${JOBS[i*COLS+7]} ${JOBS[i*COLS+8]}  test.txt
done

for ((i=0;iNUMJOBS;i++)) do
  printf \nFiles for Job %s\n ${JOBS[i*COLS]}  test.txt
  mysql --host=$DBHOST --database=$DATABASE --user=$USER
--password=$PASSWORD -N -e SELECT Path.Path,Filename.Name FROM
File,Filename,Path WHERE File.JobId=\${JOBS[i*COLS]}\ AND
Filename.FilenameId=File.FilenameId AND Path.PathId=File.PathId ORDER BY
Path.Path,Filename.Name  test.txt
done

Best regards,
Ana

On Wed, Apr 22, 2015 at 1:07 PM, bdam bacula-fo...@backupcentral.com
wrote:

 One final question about this - when i issue the query command from the
 console this way, is there a way to either pagenate the results or send
 them to a file so I can browse them? These are 3 months of CCTV from
 multiple cameras running 24/7 in 20 minute sections, so there are rather a
 lot of files shown!!!

 +--
 |This was sent by bill.dam...@yahoo.com via Backup Central.
 |Forward SPAM to ab...@backupcentral.com.
 +--




 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live
 exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual-
 event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
 ___
 Bacula-users mailing list
 Bacula-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/bacula-users

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] List files in a volume

2015-04-22 Thread Roberts, Ben
Hi,

 It would be far quicker to find the files I needed
 and it means I can do this search without interfering with the daily
 backups which are using the same drive. By the way, the CCTV isn't on 100%
 of the time, so having said that the files might not be present and/or the
 filenames not exact, hence the need to browse the volumes.

Bacula stores file details in two ways.

- In the catalog, indexed by JobId (which in turn is linked to a Volume via the 
VolumeMedia table). These records are held as long as the File Retention 
period. If you need to restore a file from a fixed date you can use one of the 
options in the restore bconsole command which will ultimately give you a list 
of files contained within the backup for you to mark and restore.

You can also use two query commands from the example query.sql file shipped 
with Bacula, #14 List Jobs stored for a given Volume name and #12 List Files 
for a selected JobId as an alternative to using the restore command.

Once the file retention time is reached these records are purged from the 
database and you'll have to restore the entire backup to retrieve the files, or 
us bls to list the individual volume contents.

- Within the backup volume itself as a header right before the file contents. 
bls will scan through the entire volume, collecting the file records and then 
present you with an ls -l like output. You need the volumes for this 
operation because it has to physically read the entire volume. 

bls and the related bextract are a lower-level tools intended for data 
recovery outside of typical day-to-day usage of Bacula. You will likely need to 
stop your Bacula-sd daemon in order to run them which can also be inconvenient.

Regards,
Ben Roberts

This email and any files transmitted with it contain confidential and 
proprietary information and is solely for the use of the intended recipient.
If you are not the intended recipient please return the email to the sender and 
delete it from your computer and you must not use, disclose, distribute, copy, 
print or rely on this email or its contents.
This communication is for informational purposes only.
It is not intended as an offer or solicitation for the purchase or sale of any 
financial instrument or as an official confirmation of any transaction.
Any comments or statements made herein do not necessarily reflect those of GSA 
Capital.
GSA Capital Partners LLP is authorised and regulated by the Financial Conduct 
Authority and is registered in England and Wales at Stratton House, 5 Stratton 
Street, London W1J 8LA, number OC309261.
GSA Capital Services Limited is registered in England and Wales at the same 
address, number 5320529.
--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


[Bacula-users] List files in a volume

2015-04-21 Thread bdam
I have the need to restore some CCTV data which was recorded in July 2014. The 
volume names are all right there in the pool, and I know the target date I'm 
looking for since its part of the filename. I just don't know which volume it's 
in. So an ls listing would identify it instantly. There are about a dozen 
tapes in the pool.  I saw the bls comand and that would probably work, I'd just 
stick each tape in sequentially till I saw the volume containing the data. But 
why does it need the tape? I know the volume names, can't I just do this ls 
for each one from the console without changing tapes? It would be far quicker 
to find the files I needed and it means I can do this search without 
interfering with the daily backups which are using the same drive. By the way, 
the CCTV isn't on 100% of the time, so having said that the files might not be 
present and/or the filenames not exact, hence the need to browse the volumes. 
Thanks.

+--
|This was sent by bill.dam...@yahoo.com via Backup Central.
|Forward SPAM to ab...@backupcentral.com.
+--



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users