copy
Creates a copy of a file and applies any requested updates with patch semantics. Use “files copy recursive” to copy folders.
Synopsis
Implements the API documented at https://developers.google.com/drive/api/v3/reference/files/copy
gsm files copy [flags]
Options
--appProperties strings A collection of arbitrary key-value pairs which are private to the requesting app.
Entries with null values are cleared in update and copy requests.
--copyRequiresWriterPermission Whether the options to copy, print, or download this file, should be disabled for readers and commenters.
--description string A short description of the file.
--fields string Fields allows partial responses to be retrieved.
See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.
--fileId string The ID of the file
-h, --help help for copy
--id string The ID of the file.
--ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file.
Domain administrators can choose to make all uploaded files visible to the domain by default;
this parameter bypasses that behavior for the request.
Permissions are still inherited from parent folders.
--includePermissionsForView string Specifies which additional view's permissions to include in the response.
Only 'published' is supported.
--keepRevisionForever Whether to set the 'keepForever' field in the new head revision.
This is only applicable to files with binary content in Google Drive.
Only 200 revisions for the file can be kept forever.
If the limit is reached, try deleting pinned revisions.
--mimeType string The target MIME type of the file.
Google Drive will attempt to automatically detect an appropriate value from uploaded content if no value is provided.
The value cannot be changed unless a new revision is uploaded.
If a file is created with a Google Doc MIME type, the uploaded content will be imported if possible.
The supported import formats are published in the About resource.
--modifiedTime string The last time the file was modified by anyone (RFC 3339 date-time).
Note that setting modifiedTime will also update modifiedByMeTime for the user.
--name string The name of the file. This is not necessarily unique within a folder.
Note that for immutable items such as the top level folders of shared drives, My Drive root folder, and Application Data folder the name is constant.
--ocrLanguage string A language hint for OCR processing during image import (ISO 639-1 code).
--parent string The single parent of the file.
--properties strings A collection of arbitrary key-value pairs which are visible to all apps.
Entries with null values are cleared in update and copy requests.
--readOnly Whether the content of the file is read-only.
If a file is read-only, a new revision of the file may not be added, comments may not be added or modified, and the title of the file may not be modified.
--readOnlyReason string Reason for why the content of the file is restricted.
This is only mutable on requests that also set readOnly=true.
--starred Whether the user has starred the file.
--thumbnailImage string The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
--thumbnailMimeType string The MIME type of the thumbnail.
--viewedByMeTime string The last time the file was viewed by the user (RFC 3339 date-time).
--writersCanShare Whether users with only writer permission can modify the file's permissions.
Not populated for items in shared drives.
Options inherited from parent commands
--compressOutput By default, GSM outputs "pretty" (indented) objects. By setting this flag, GSM's output will be compressed. This may or may not improve performance in scripts.
--config string config file (default is $HOME/.config/gsm/.gsm.yaml)
--delay int This delay (plus a random jitter between 0 and 50) will be applied after every command to avoid reaching quota and rate limits. Set to 0 to disable.
--dwdSubject string Specify a subject used for DWD impersonation (overrides value in config file)
--log string Set the path of the log file. Default is either ~/gsm.log or defined in your config file
--maxElapsedTime int This is the maximum total time that will be spent retrying a request in minutes. (default 15)
--maxRetryInterval int This is the maximum interval that will be used between retry attempts in seconds. (default 320)
--redirectPort int This is the TCP port on which GSM will create web server if you authenticate with a user account for the first time. This is necessary for the OAuth flow. See https://developers.google.com/identity/protocols/oauth2/native-app#redirect-uri_loopback (default 8081)
--retryOn ints Specify the HTTP error code(s) that GSM should retry on. Note that GSM will always retry on HTTP 403 errors that indicate a quota / rate limit error
--streamOutput Setting this flag will cause GSM to output slice values to stdout one by one, instead of one large object
SEE ALSO
- gsm files - Managed files (Part of Drive API)
- gsm files copy batch - Batch copies files using a CSV file as input.
- gsm files copy recursive - Recursively copies a folder to a new destination.