Copy files from csv to Shared Drive

82 views
Skip to first unread message

Braden Vawdrey

unread,
Aug 21, 2024, 5:38:25 PM8/21/24
to GAM for Google Workspace
I've got a list of files that are all in a .csv file. They are all inside of individual users 'My Drive'. I need to pass the .csv in and make a copy of all the files and copy them into a Shared Drive. The csv headers are named Owner and FileID with the respective info.

I've been trying to run the following command:

gam csv ~/Documents/test-files-to-copy.csv gam redirect stdout ./files-copied.csv redirect stderr ./files-error.csv user "~Owner" copy drivefile "~FileID" teamdriveparentid 0AEyLzPHBZSv0Uk9PVA mergewithparent no recursive depth -1

The error I got in the error out file is: "Shared Drive ID: 0AEyLzPHBZSv0Uk9PVA Permission ID: 13612448801352578291 Does not exist"

I double checked the Drive ID and it is most definitely correct. I've also double checked that all the users have access to the Shared Drive as Content Managers.

Not sure what else I can do. Any ideas from anyone? Maybe I'm going about this the wrong way.

Braden Vawdrey

unread,
Aug 21, 2024, 7:04:57 PM8/21/24
to GAM for Google Workspace
I'd also add to my original post, I don't want any users to get emails about new files or anything. Not 100% how to do that in this process or if that's the default.


I found that each of the users have to be added INDIVIDUALLY to the shared drive with Manager permissions to get rid of the permissions "Does not exist" error. This is specified in the Github Wiki, I just missed it while reading through. It's quite easy to miss.

Using the following command now and it works:

gam csv ~/Documents/files-to-copy.csv gam user "~Owner" copy drivefile "~FileID" teamdriveparent "<Shared Drive Name>" teamdriveparentname ""<Shared Drive Folder Name>"

I left off the recursive depth because all of the files I am copying are individual files and not folders.


Rosemarie Scanlon

unread,
Aug 22, 2024, 7:19:29 AM8/22/24
to google-ap...@googlegroups.com
Thanks for adding the update Braden. 
If the accounts are already suspended, the user won't get an email. It's worth testing.
Does it take long to copy the data?


Rosemarie



From: 'Braden Vawdrey' via GAM for Google Workspace <google-ap...@googlegroups.com>
Sent: Thursday 22 August 2024 00:04
To: GAM for Google Workspace <google-ap...@googlegroups.com>
Subject: [GAM] Re: Copy files from csv to Shared Drive
 

[EXTERNAL] This email was sent from outside of UCC.

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/66576ee2-7a9c-4105-b814-9165e6a216b2n%40googlegroups.com.

Braden Vawdrey

unread,
Aug 22, 2024, 11:35:26 AM8/22/24
to GAM for Google Workspace
Hey Rosemarie.

None of the accounts are suspended. Thats a good thought.

It does take a while to copy the data. It copied around 1000 files in a little over an hour.

Reply all
Reply to author
Forward
0 new messages