Can I synchronize a local folder with a cloud storage bucket?

0 votes
I want the contents of a local folder and that of my cloud storage bucket to be in sync. Is this possible? How can I synchronize the data in the two?
Nov 21 in GCP by anonymous
• 6,650 points
9 views

1 answer to this question.

0 votes

If you want to synchronize a local directory with a bucket or vice versa, you can do that with the gsutil rsync command. 

For example, to make gs://example-bucket match the contents of the local directory local-dir you can use:

gsutil -m rsync -r local-dir gs://example-bucket

If you use the rsync -d flag, it signals gsutil to delete files at the destination (gs://example-bucket in the command above) that aren't present at the source (local-dir). 

answered Nov 21 by Sirajul
• 40,980 points

Related Questions In GCP

0 votes
1 answer

Listing the contents of a cloud storage bucket folder.

Use the gsutil ls command to list the contents ...READ MORE

answered Oct 23 in GCP by Sirajul
• 40,980 points
21 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9 in GCP by Sirajul
• 40,980 points
32 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10 in GCP by Sirajul
• 40,980 points
93 views
0 votes
1 answer