LOADING
×

Folder Upload & Download in GCS

The following procedure is about file upload and download in Google Cloud Storage using Cloud SDK.

Folder Upload & Download in GCS

Google Cloud Storage is a cloud product offered by Google. It offers a large amount of storage space for organization data and individual objects can be of maximum 5TB. Cloud Storage is generally used for archival and data backup and allows the user to access it from any location. This acts as a backup plan for the emergency case by providing a second copy of the data. The following steps are the ways to upload and download files from Google Cloud Storage.

1. Download Google Cloud SDK
https://www.google.com/url?q=https://cloud.google.com/sdk/docs/downloads-interactive&sa=D&source=hangouts&ust=1540552969713000&usg=AFQjCNE2JxBZGEjEc-DUwpc07ijE6Jz6aA

2. Install SDK

3. Create a bucket in GCP console where the contents will be stored.



4. To upload contents from local to cloud, copy the command and paste.
gsutil -m cp -R "Your local directory" gs://Your bucket name



5. Create a batch file in Desktop “upload.bat” and paste the same command in it.

6. Run the command. The files will be uploaded in the bucket.

As the command is contained in the .bat file, the files associated with the local path will be uploaded to the console.

7. To download contents from cloud to local, make a folder where the files will be downloaded.

8. Copy the command and paste.
gsutil -m cp -R Your bucket name   gs://”Your local directory where files will be saved”



9. The files will be downloaded to the mentioned folder in your machine.



To automate uploading and downloading we can use Task Scheduler for Windows.

1. As mentioned in the above steps, create a file upload.bat  and paste the above-mentioned command for it.



2. Open Task Scheduler and create a task



3. In Trigger, go to new and give a date and time for automated backup.



4. In Action, go to new and paste the upload.bat file path there.


    

At the given time, the existing and new files will be uploaded.





Trendy