We need to scan files with google dlp. However google dlp scanning is only supported in gcs. (https://cloud.google.com/blog/products/identity-security/take-charge-of-your-data-scan-for-sensitive-data-in-just-a-few-clicks) So I need to export the files with known file ID, to GCS and apply the google dlp scanning there. Is there anybody here know that how to export files from google drive to GCS without manual intervention?
Asked
Active
Viewed 240 times
1 Answers
2
This might do the trick
https://colab.research.google.com/drive/1Xc8E8mKC4MBvQ6Sw6akd_X5Z1cmHSNca
from google.colab import drive
drive.mount('/content/drive')
from google.colab import auth
auth.authenticate_user()
project_id = 'your-project-id'
!gcloud config set project {project_id}
!gsutil ls
bucket_name = 'medium_demo_bucket_190710'
!gsutil -m cp -r /content/drive/My\ Drive/Data/* gs://{bucket_name}/

Jordanna Chord
- 950
- 5
- 12
-
It is very helpful. Appreciate that. What about auth? I didn't see that a login or credential file is required for auth. – hans Aug 18 '20 at 05:05