-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbacula_queries.txt
17 lines (14 loc) · 923 Bytes
/
bacula_queries.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
SELECT distinct m.volumename, s.name, m.volstatus, j.jobtdate, j.filesetid, j.clientid, j.level,
j.name FROM media m, storage s, job j, jobmedia jm WHERE m.storageid=s.storageid AND
jm.mediaid=m.mediaid AND jm.jobid=j.jobid;
# Selektiere client/fileset mit volstatus
SELECT distinct j.jobid, m.mediaid, m.volumename, s.name, m.volstatus, j.jobtdate, j.filesetid, j.clientid,
j.level,
j.name FROM media m, storage s, job j, jobmedia jm WHERE m.storageid=s.storageid AND
jm.mediaid=m.mediaid AND jm.jobid=j.jobid AND j.clientid=1 AND j.filesetid=7 ORDER BY j.jobid;
# manipulate volstatus to purged (testing purpose)
UPDATE media SET volstatus='Purged' WHERE mediaid=126;
# selecting all backups
SELECT distinct m.volumename, s.name, m.volstatus, j.jobtdate, j.filesetid, j.clientid, j.level,
j.name FROM media m, storage s, job j, jobmedia jm WHERE m.storageid=s.storageid AND
jm.mediaid=m.mediaid AND jm.jobid=j.jobid;