r8651@llin: dpavlin | 2005-10-20 23:54:45 +0200
authordpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Sat, 22 Oct 2005 15:40:33 +0000 (15:40 +0000)
committerdpavlin <dpavlin@8392b6e1-25fa-0310-8288-cc32f8e212ea>
Sat, 22 Oct 2005 15:40:33 +0000 (15:40 +0000)
 dump all files in pool from database

git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/BackupPC/trunk@219 8392b6e1-25fa-0310-8288-cc32f8e212ea

sql/all_files.sql [new file with mode: 0644]

diff --git a/sql/all_files.sql b/sql/all_files.sql
new file mode 100644 (file)
index 0000000..e2a0bbd
--- /dev/null
@@ -0,0 +1,20 @@
+-- dump all files. Might be VERY VERY slow on large backup pools
+
+select
+       files.id as unique_id,
+       hosts.name as host,
+       shares.name as share,
+       backupnum as num,
+       backups.date as backup_date,
+       backups.type as type,
+       files.path as path,
+       files.date as date,
+       files.size as size,
+       backups.size as backup_size
+from files
+join shares on files.shareid = shares.id
+join hosts on shares.hostid = hosts.id
+join backups on shares.hostid = backups.hostid
+       and files.backupnum = backups.num
+       and shares.id = backups.shareid
+order by backups.date;