Copy Drive Folders

1,573 views
Skip to first unread message

George Lawson-Crowson

unread,
Aug 7, 2018, 4:55:24 PM8/7/18
to google-ap...@googlegroups.com
Hi All,

I'm wondering if GAM has a command to "copy" or symlink a drive folder from one place to another. I'd like to have the same folder appear in two places. All tips are appreciated.

Sincerely,
George Crowson
Systems Developer
Southwestern University

+KimNilsson

unread,
Aug 8, 2018, 1:51:19 AM8/8/18
to GAM for G Suite
To symlink a folder is just a simple share. Then you can push that share to appear in a another user's root of My Drive.

To copy a folder is a whole other business, and a lot messier, and maybe not what you want.

George Lawson-Crowson

unread,
Aug 8, 2018, 2:14:40 PM8/8/18
to google-ap...@googlegroups.com
I know I can use drivefileacl to add shares, but how would I push that share to a folder in their My Drive?

Thanks for the help,
George

On Wed, Aug 8, 2018 at 12:51 AM, +KimNilsson <there.is.no...@gmail.com> wrote:
To symlink a folder is just a simple share. Then you can push that share to appear in a another user's root of My Drive.

To copy a folder is a whole other business, and a lot messier, and maybe not what you want.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/2c19dcf3-0c2e-463d-b42e-34d5c74e087f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

George Lawson-Crowson

unread,
Aug 8, 2018, 2:23:18 PM8/8/18
to google-ap...@googlegroups.com
It's worth noting that copying folders has gotten a lot easier with gamadv-xtd:

gam <who> copy drivefile <DriveFileEntity> [newfilename <DriveFileName>] [recursive] [parentid <DriveFolderID>] [parentname <DriveFolderName>]

and there's ownership transfers for folders, too:

gam <who> transfer ownership <DriveFileEntity> <UserItem> [includetrashed] (orderby <DriveOrderByFieldName> [ascending|descending])* [preview] [filepath] [todrive [<ToDriveAttributes>]]

George

On Wed, Aug 8, 2018 at 1:14 PM, George Lawson-Crowson <crow...@southwestern.edu> wrote:
I know I can use drivefileacl to add shares, but how would I push that share to a folder in their My Drive?

Thanks for the help,
George
On Wed, Aug 8, 2018 at 12:51 AM, +KimNilsson <there.is.no.substitute@gmail.com> wrote:
To symlink a folder is just a simple share. Then you can push that share to appear in a another user's root of My Drive.

To copy a folder is a whole other business, and a lot messier, and maybe not what you want.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

+KimNilsson

unread,
Aug 12, 2018, 3:35:04 AM8/12/18
to GAM for G Suite
I've previously, before Team Drives, used this simple syntax.

gam user <UserTypeEntity> update drivefile id 0abz1234 parentid root

Scheduled that to run once every day, so any new user will get the folder pushed to their root of My Drive.
As I said, this will be the same folder, so this is for when you wish to have a single collaborative folder, and not a copy.

/Kim

Peter Smulders

unread,
Aug 19, 2018, 6:56:44 AM8/19/18
to GAM for G Suite
There are two relevant concepts you need to be aware of:

1) ACLs on files
2) parent attribute for a given file

(1) provides access for user X to file Z. It says nothing about where that file appears in the user's drive, if it appears at all. (the file will still be visible in 'Shared with me')
(2) by setting the parent to Root for a given user, or a particular folder that is already visible in that user's Drive, the file appears in that place.

It is possible (and somewhat strange to users only familiar with 'normal' files in Windows that appear in one and only one place) to have a single file appear in more than one place: just add additional parents to the file:

gam <UserTypeEntity> update drivefile <DriveFileEntity> addparents <DriveFolderIDList>


If you copy a file, a new instance gets created and you end up with independant files with identical names and stored (appearing) in two places, which is not the same as the same file appearing in two places.

--peter
Reply all
Reply to author
Forward
0 new messages