1 |
-- find backups without corresponding rows in backup_parts (database consistency check) |
2 |
select hosts.name as host, shares.name as share, backups.num, backups.date::abstime, type, size, inc_size, inc_deleted, parts, dvd_nr |
3 |
from backups |
4 |
join hosts on hostid=hosts.id |
5 |
join shares on shareid=shares.id |
6 |
full outer join archive_backup on archive_backup.backup_id = backups.id |
7 |
full outer join archive on archive.id = archive_backup.archive_id |
8 |
where backups.id not in (select backup_id from backup_parts) |
9 |
and inc_deleted is false |
10 |
and size > 0 |
11 |
order by host,share,num |
12 |
; |