Skip to content

Commit

Permalink
improved folder exclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
davedavemckay committed Jul 26, 2024
1 parent 601bfa3 commit 6b12a7a
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions csd3-side/scripts/lsst-backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ def process_files(s3_host, access_key, secret_key, bucket_name, current_objects,
if folder in exclude:
print(f'Skipping subfolder {folder} - excluded.')
continue
# remove subfolders in exclude list
sub_folders = [sub_folder for sub_folder in sub_folders if sub_folder not in exclude]

folder_files = [os.sep.join([folder, filename]) for filename in files]
total_filesize = sum([os.stat(filename).st_size for filename in folder_files])
Expand Down Expand Up @@ -853,13 +855,6 @@ def error(self, message):
if not dryrun:
print(f'Bucket exists: {bucket_name}')
print('Existing files will be skipped.')
# continue_ = input("Continue? [y/n]\n").lower()
# if continue_ == 'n':
# sys.exit('Bucket exists.')
# elif continue_ == 'y':
# print('Continuing')
# else:
# sys.exit('Invalid input.')
else:
print(f'Bucket exists: {bucket_name}')
print('dryrun == True, so continuing.')
Expand Down

0 comments on commit 6b12a7a

Please sign in to comment.