/[BackupPC]/trunk/sql/dvd_backup_parts_consistency_report.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/sql/dvd_backup_parts_consistency_report.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 301 - (hide annotations)
Thu Jan 26 23:24:11 2006 UTC (18 years, 4 months ago) by dpavlin
File size: 837 byte(s)
if BackupPC_burnArchiveCLI complains about consistency error in backup_parts,
this query will report which backups are problem
1 dpavlin 301 -- check consistency of data for one DVD image. This is more detailed than
2     -- error message from BackupPC_Bur
3     select
4     hosts.name || '_' ||
5     shares.name || '_' ||
6     backups.num as increment_name,
7     backups.date::abstime,
8     backups.type,
9     backups.size,
10     backups.parts,
11     count(backup_parts.backup_id) as backup_parts,
12     backups.inc_size,
13     backups.inc_deleted
14     from archive_backup
15     join archive on archive_id = archive.id
16     join backups on backup_id = backups.id
17     join shares on shareid = shares.id
18     join hosts on backups.hostid = hosts.id
19     full outer join backup_parts on backups.id = backup_parts.backup_id
20     -- where dvd_nr = 14
21     group by
22     hosts.name,
23     shares.name,
24     backups.num,
25     backups.date,
26     backups.type,
27     backups.size,
28     backups.parts,
29     backups.inc_size,
30     backups.inc_deleted
31     having count(backup_parts.backup_id) <> parts
32     order by inc_size desc
33     ;

  ViewVC Help
Powered by ViewVC 1.1.26