FileServerDedupe/Generate Egnyte Export.sql

27 lines
818 B
MySQL
Raw Normal View History

2023-09-14 15:29:46 -06:00
-- Generate Non-Duplicated PARENT FOLDER List
DROP TABLE DataInventory;
CREATE TABLE DataInventory AS
2023-09-15 14:07:21 -06:00
Select *
from (
SELECT SERVER,
REPLACE(
Parent,
"X:\","\\mpe.ca\datadrive\") AS UNCPath,
2023-09-15 14:18:19 -06:00
REPLACE(REPLACE(Parent,("X:\" || Server),"/Shared/N-Data"),"\","/") AS EgnytePath,
sum(FileCount) as FileCount, Sum(FileSize) as FileSize, 'Parent' as Source from FolderData
2023-09-15 16:19:24 -06:00
Where Parent in (
SELECT Parent FROM NonDupParent
2023-09-15 13:04:44 -06:00
)
GROUP by UNCPath
2023-09-14 15:29:46 -06:00
)
2023-09-15 16:19:24 -06:00
union
SELECT SERVER,
2023-09-15 14:07:21 -06:00
REPLACE(PATH,"X:\","\\mpe.ca\datadrive\") AS UNCPath,
2023-09-15 14:18:19 -06:00
REPLACE(REPLACE(PATH,("X:\" || Server),"/Shared/N-Data"),"\","/") AS EgnytePath,
2023-09-18 11:38:53 -06:00
FileCount, FileSize, 'Project' as Source from FolderData
2023-09-15 16:19:24 -06:00
Where FolderData.Project in (
SELECT Project FROM NonDupProject)
-- AND FolderData.Parent in (
-- Select Parent FROM NonDupParent
-- );