Google Drive and Shared Drives, Duplicate files

Hi,

Can anyone recommend a process or add-on that can find duplicate files in Google Drive and Google Shared Drives? We have a large amount of data and a cursory look indicates that there are duplicate files and this leads to different versions being edited by different people leading to inaccurate data. We can train the staff but we need to get to a point where we have consistent accurate data.

0 3 3,304
3 REPLIES 3

Hi @LeeC , I am not aware of any add-on like this, that I could recommend, but one thing that came to my mind is, that if you are familiar with GAM you can list all the Drive/Shared Drive files into the Spreadsheet
You would need to execute a few commands in bulk mode, using previously exported CSV - separately for My Drives and Shared Drives:

My Drives:
gam print users > users.csv
gam csv users.csv gam user ~primaryEmail print filelist todrive

Shared Drives:
gam print teamdrives >shareddrives.csv
gam csv shareddrives.csv gam user ~User print filelist select teamdriveid ~id todrive

As the output you should get the list of files on both My Drives and Shared Drives of all of the users. Then you can simply use Spreadsheet to compare these (using IF or different formulas to compare the size and name of the files).

Then what left is the deletion process - it can be also done using GAM, based on the file ID (you could do this in bulk as previous commands).

I know that this might sound a little bit complex, but it should be pretty straightforward.

Hope this helps,
Best,
Marcin

Thank you Marcin.  The teamdrives command failed with:
ERROR: teamdrives is not a valid argument for "gam print"

And the Shared drive command failed with:
ERROR: CSV file shareddrives.csv is empty

When I ran "gam csv users.csv gam user ~primaryEmail print filelist todrive" it created a file for each person with a list of their documents.  Unfortunately, that's over 80 files to sift through.

Any ideas?

Hi @Tovuti_Dan, Do you use standard GAM or GAM-ADV-XTD3? - Apologies, I forgot to mention that I've run my commands on the second. 

As a result of this command, you should have a single file with all shared drive's items listed. 

gam csv shareddrives.csv gam user ~User print filelist select teamdriveid ~id todrive

If you would like to run the command using standard GAM,  you would need to use a little bit different commands, as explained here.

Hope this helps,
Have a good day,
Marcin

Top Labels in this Space
Top Solution Authors