/[BackupPC]/trunk/sql/zz_dst_files_fix.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

Contents of /trunk/sql/zz_dst_files_fix.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 240 - (show annotations)
Thu Nov 17 17:22:31 2005 UTC (18 years, 6 months ago) by dpavlin
File size: 805 byte(s)
added SQL which delete all backups afeter daylight saving time change.
added cludge which tolerate +/- 1 hour difference in mtime from (probably
windows) hosts which drift when DST is in action, thus producing duplicate
entries

1 select hostid,shareid,num,abstime(date),size,inc_size into dst_files from backups where date > abstime('2005-10-24')::int order by abstime,hostid,num;
2
3 delete from backups where date > abstime('2005-10-24')::int;
4 vacuum analyze backups;
5
6 create index dst_i1 on dst_files(shareid) ;
7 create index dst_i2 on dst_files(num) ;
8 vacuum analyze dst_files ;
9 create index dst_i3 on files(backupnum) ;
10 vacuum analyze files ;
11
12 select id into dst_files_ids from files inner join dst_files on dst_files.shareid = files.shareid and dst_files.num = files.backupnum ;
13 create unique index dst_i4 on dst_files_ids(id) ;
14 vacuum analyze dst_files_ids ;
15
16 delete from files where id in (select id from dst_files_ids) ;
17
18 vacuum full analyze verbose files ;
19
20 drop table dst_files_ids ;
21 drop table dst_files ;
22
23 drop index dst_i3 ;

  ViewVC Help
Powered by ViewVC 1.1.26