I have one folder called all-files
on s3 bucket which has 35K files. I have one CSV file (errors.csv) which has 1K filenames and this filenames are sub-set of 35K filenames. I need to copy 1k files (which are from csv) from 35K all-files
folder to some new folder called errors
on same bucket.
反正有可能吗?如果是,怎么办?
I tried soemthing with cp
command with include
pattern but it seems does not support input from csv file.
由于您不确定是否使用Linux,因此假设使用Linux。
The most basic way of doing this in
bash
is as follows (you haven't provided any example file content to work with):Read line-by-line from
/tmp/files.csv
and execute theaws s3 mv
:结果是:
更复杂的示例包括通过同时移动几个文件来同时运行命令。但是,无论您同时移动10个文件还是一次移动10个文件,想法都是相同的。