FileServerDedupe/Generate Egnyte Export.sql

24 lines
876 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
Select * from (
2023-09-15 14:07:21 -06:00
SELECT SERVER,
REPLACE(
Parent,
"X:\","\\mpe.ca\datadrive\") AS UNCPath,
2023-09-27 16:25:40 -06:00
REPLACE(REPLACE(Parent,("\\mpe.ca\datadrive\" || Server),"/Shared/N-Data"),"\","/") AS EgnytePath,
sum(FileCount) as FileCount, Sum(FileSize) as FileSize, 'Parent' as Source, Status from FolderData
Where Parent in (
SELECT Parent FROM NonDupParent
)
AND FolderData.fld_MigrationID IS NULL
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-27 16:25:40 -06:00
REPLACE(REPLACE(PATH,("\\mpe.ca\datadrive\" || Server),"/Shared/N-Data"),"\","/") AS EgnytePath,
FileCount, FileSize, 'Project' as Source, Status from FolderData
2023-09-15 16:19:24 -06:00
Where FolderData.Project in (
SELECT Project FROM NonDupProject)
AND FolderData.fld_MigrationID IS NULL;