<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GCP - TheCodeBuzz</title>
	<atom:link href="https://thecodebuzz.com/category/gcp/feed/" rel="self" type="application/rss+xml" />
	<link>https://thecodebuzz.com</link>
	<description>Best Practices for Software Development</description>
	<lastBuildDate>Sat, 08 Apr 2023 00:42:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://thecodebuzz.com/wp-content/uploads/2022/11/cropped-android-chrome-512x512-1-1-51x51.jpg</url>
	<title>GCP - TheCodeBuzz</title>
	<link>https://thecodebuzz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Archive,Move Or Copy File Google Cloud Storage Bucket gsutil</title>
		<link>https://thecodebuzz.com/move-copy-archive-file-google-bucket-storage-gsutil/</link>
					<comments>https://thecodebuzz.com/move-copy-archive-file-google-bucket-storage-gsutil/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 25 Feb 2021 20:35:00 +0000</pubDate>
				<category><![CDATA[GCP]]></category>
		<category><![CDATA[copy files from one gcs bucket to another python]]></category>
		<category><![CDATA[gsutil -m]]></category>
		<category><![CDATA[gsutil commands]]></category>
		<category><![CDATA[gsutil cp]]></category>
		<category><![CDATA[gsutil ls]]></category>
		<category><![CDATA[gsutil rsync]]></category>
		<category><![CDATA[gsutil rsync vs cp]]></category>
		<category><![CDATA[gsutil vs gcloud]]></category>
		<guid isPermaLink="false">https://www.thecodebuzz.com/?p=15663</guid>

					<description><![CDATA[<p>gsutil Move, Copy, Archive Rename file/objects from Google Bucket Today in this article we shall see how to use gsutil command-line tool to Archive,Move Or Copy File Google Cloud Storage Bucket gsutil As we took deep dive into the previous article on gsutil, where we understood it is actually a Python command-line application that lets [&#8230;]</p>
<p>The post <a href="https://thecodebuzz.com/move-copy-archive-file-google-bucket-storage-gsutil/">Archive,Move Or Copy File Google Cloud Storage Bucket gsutil</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></description>
										<content:encoded><![CDATA[<h1 class="wp-block-heading">gsutil Move, Copy, Archive Rename file/objects from Google Bucket</h1>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="351" src="https://www.thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-1024x351.jpg" alt="gsutil Move file, gsutil Archive file, gsutil copy file, Archive,Move Or Copy File Google Cloud Storage Bucket gsutil" class="wp-image-21357" srcset="https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-1024x351.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-300x103.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-768x263.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-1536x526.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil-785x269.jpg 785w, https://thecodebuzz.com/wp-content/uploads/2022/03/Move-Copy-Archive-file-Google-storage-Bucket-gsutil.jpg 1701w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Today in this article we shall see how to use <strong><em>gsutil </em></strong>command-line tool to Archive,Move Or Copy File Google Cloud Storage Bucket gsutil</p>



<p></p>



<p>As we took deep dive into the previous article on <strong><em>gsutil, </em></strong>where we understood it is actually a Python command-line application that lets you access Cloud Storage. </p>



<p>You can use <strong><em>gsutil </em></strong>to perform a lot of operations including uploads and downloads etc. using HTTPS and transport-layer security (TLS) etc.</p>



<p>Today in this article, we will cover below aspects,</p>



<div class="wp-block-aioseo-table-of-contents"><ul><li><a href="#aioseo-prerequisites">Prerequisites</a></li><li><a href="#aioseo-moving-file-with-in-a-google-bucket">Moving file with in a Google Bucket</a></li><li><a href="#aioseo-moving-file-from-one-bucket-to-other-bucket-storage">Moving file from one bucket to other bucket storage</a></li><li><a href="#aioseo-list-of-contents-file-of-a-bucket-or-folder">List of contents/file of a bucket or folder</a></li></ul></div>



<p>The&nbsp;<code>gsutil </code><strong><code>mv</code>&nbsp;</strong>the<strong> </strong>command allows you to move data between your local file system and the cloud, move data within the cloud, and move data between cloud storage providers</p>



<p></p>



<h2 class="wp-block-heading" id="aioseo-prerequisites">Prerequisites</h2>



<p></p>



<ul class="wp-block-list"><li><strong><em>Create an account&nbsp;in the google cloud project.</em></strong></li></ul>



<ul class="wp-block-list"><li><strong><em>Install the <a href="https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe" target="_blank" rel="noreferrer noopener">Google Cloud SDK</a></em></strong></li></ul>



<p></p>



<h2 class="wp-block-heading" id="aioseo-moving-file-with-in-a-google-bucket">Moving file with in a Google Bucket </h2>



<p></p>



<p>We can easily use the mv command which lets you move from a <em>source location to the target </em>location. You can move data between<em> local files</em> and <em>the cloud, move data between cloud storage providers</em> or <em>move data within the cloud</em>.</p>



<p>Here default Move command is actually a combination of moving the file to a new location plus deleting of file from the source location.</p>



<p></p>



<p><strong>Command Pattern</strong></p>



<p></p>



<pre class="wp-block-preformatted has-medium-font-size">gsutil mv [source-gcs-path] [target-gcs-path]</pre>



<p></p>



<p><strong>Example</strong></p>



<p></p>



<p class="has-medium-font-size">gsutil mv gs://thecodebuzz/load-from-gcutil/thecodebuzz.png gs://thecodebuzz/Archive</p>



<p></p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://www.thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-1024x399.jpg" alt="Archive file Google Bucket" class="wp-image-15664" width="491" height="190" srcset="https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-1024x399.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-300x117.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-768x299.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-1536x598.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-2048x797.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-objects-Google-Bucket-785x306.jpg 785w" sizes="(max-width: 491px) 100vw, 491px" /></figure>



<p></p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="353" src="https://www.thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-1024x353.jpg" alt="" class="wp-image-15667" srcset="https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-1024x353.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-300x103.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-768x265.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-1536x529.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-2048x705.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-Move-Copy-Archive-rename-file-Google-Bucket-storage-785x270.jpg 785w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<h2 class="wp-block-heading" id="aioseo-moving-file-from-one-bucket-to-other-bucket-storage">Moving file from one bucket to other bucket storage</h2>



<p></p>



<p><strong>Command Pattern</strong></p>



<p></p>



<p class="has-medium-font-size">gsutil mv [source-gcs-path] [target-gcs-path]</p>



<p></p>



<p><strong>Example</strong></p>



<p></p>



<p class="has-medium-font-size">gsutil mv gs://thecodebuzz/load-from-gcutil/TheCodeBuzz.png gs://test-bucket-13/Archive</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="249" src="https://www.thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-1024x249.jpg" alt="Move ,archive file from one bucket to other bucket storage" class="wp-image-15670" srcset="https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-1024x249.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-300x73.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-768x187.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-1536x373.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-2048x497.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-785x191.jpg 785w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>The above logic works for Jpeg or png or .text, pdf, or any file type.</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="212" src="https://www.thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-1024x212.jpg" alt="Move, Copy, Archive file Google Bucket gsutil" class="wp-image-15671" srcset="https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-1024x212.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-300x62.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-768x159.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-1536x317.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-2048x423.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2021/04/Moving-file-from-one-bucket-to-other-google-bucket-storage-gsutil-785x162.jpg 785w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<h2 class="wp-block-heading" id="aioseo-list-of-contents-file-of-a-bucket-or-folder">List of contents/file of a bucket or folder</h2>



<p></p>



<p>Please use the&nbsp;<code><strong><em>ls</em></strong></code>&nbsp;command to list the contents at the top level of your bucket.</p>



<p></p>



<p><strong>Command Pattern</strong></p>



<p></p>



<p><em>gsutil ls [source-bucket-path]</em></p>



<p></p>



<p><strong>Example </strong></p>



<p></p>



<p class="has-medium-font-size"><em>gsutil ls gs://thecodebuzz/</em></p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="243" src="https://www.thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-1024x243.jpg" alt="Moving file from one bucket to other bucket storage" class="wp-image-15672" srcset="https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-1024x243.jpg 1024w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-300x71.jpg 300w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-768x183.jpg 768w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-1536x365.jpg 1536w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-2048x487.jpg 2048w, https://thecodebuzz.com/wp-content/uploads/2021/04/gsutil-get-list-of-all-files-from-google-bucket-storage-785x187.jpg 785w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<p style="font-size:18px">Do you have any <strong>comments or ideas or any better </strong>suggestions to share?</p>



<p class="has-small-font-size"></p>



<p style="font-size:18px">Please sound off your comments below.</p>



<p class="has-medium-font-size"></p>



<p class="has-medium-font-size"><strong>Happy Coding </strong>!!</p>



<p></p>



<hr>



<p class=""></p>



<p class="has-background" style="background-color:#b6d9ac;font-size:18px"><br>Please <strong><em>bookmark </em></strong>this page and <em><strong>share </strong></em>it with your friends.                                                    Please <a href="https://www.thecodebuzz.com/subscription/" target="_blank" rel="noreferrer noopener"><em><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color"><strong>Subscribe</strong> </mark></em></a>to the blog to receive notifications on freshly published (2025) best practices and guidelines for software design and development.</p>




<br>



<hr>



<p class=""></p>



<p></p><p>The post <a href="https://thecodebuzz.com/move-copy-archive-file-google-bucket-storage-gsutil/">Archive,Move Or Copy File Google Cloud Storage Bucket gsutil</a> first appeared on <a href="https://thecodebuzz.com">TheCodeBuzz</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://thecodebuzz.com/move-copy-archive-file-google-bucket-storage-gsutil/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
