Reputation: 5190
I have a directory in a gcp storage bucket. And there are 2 subdirectories in that bucket.
Is there a way to download files which are created in last 24 hours in those subdirectories using gsutil
command from console?
Upvotes: 0
Views: 689
Reputation: 5190
I was able to achieve part of it using gcp console and shell.
Steps:
Upvotes: 0
Reputation: 81424
gsutil does not support filtering by date.
An option is to create a list of files to download via another tool or script, one object name per line.
Use stdin to specify a list of files or objects to copy. You can use gsutil in a pipeline to upload or download objects as generated by a program. For example:
cat filelist | gsutil -m cp -I gs://my-bucket
or:
cat filelist | gsutil -m cp -I ./download_dir
where the output of cat filelist is a one-per-line list of files, cloud URLs, and wildcards of files and cloud URLs.
Upvotes: 2