Skip to content

Commit dbfc5aa

Browse files
committed
add shell script to easily copy dir structure to s3
1 parent 26bbb66 commit dbfc5aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

generator/s3Copy.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
path=$1 # the path of the directory where the files and directories that need to be copied are located
2+
s3Dir=$2 # the s3 bucket path
3+
4+
for entry in "$path"/*; do
5+
name=`echo $entry | sed 's/.*\///'` # getting the name of the file or directory
6+
if [[ -d $entry ]]; then # if it is a directory
7+
aws s3 cp --recursive "$name" "$s3Dir/$name/"
8+
else # if it is a file
9+
aws s3 cp "$name" "$s3Dir/" --exclude "generator.py" --exclude "raw_boards.json" --exclude "s3Copy.sh"
10+
fi
11+
done

0 commit comments

Comments
 (0)