Skip to content

Commit

Permalink
add file size
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahag Gragoosian Namagerdi committed Sep 10, 2023
1 parent 4a7dce4 commit 8fdab9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion list_objects_via_byte/listObjects.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

bucket_name = "EXAMPLE" #Write your Bucket name
base_path = "FOLDER1/FOLDER2" #Write your object path
less_than = "1" #Less than which size you want to get the list

#if in following path you have different folders you can use following for loop if not just skip it

for pattern_number in range(1, 10):
pattern = f"{pattern_number}" # Creates pattern like PATTERN001, PATTERN002, ...
s3cmd_command = f"s3cmd --config=/app/s3cfg ls s3://{bucket_name}/{base_path}/{pattern}/ | awk '$3 < 1'"
s3cmd_command = f"s3cmd --config=/app/s3cfg ls s3://{bucket_name}/{base_path}/{pattern}/ | awk '$3 < {less_than}'"

try:
file_path = "output.txt"
Expand Down

0 comments on commit 8fdab9e

Please sign in to comment.