Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions S3/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Config(object):
default_mime_type = "binary/octet-stream"
guess_mime_type = True
# List of checks to be performed for 'sync'
no_check_md5 = False
sync_checks = ['size', 'md5'] # 'weak-timestamp'
# List of compiled REGEXPs
exclude = []
Expand Down
9 changes: 8 additions & 1 deletion s3cmd
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ def _compare_filelists(src_list, dst_list, src_is_local_and_dst_is_remote, src_a
u"XFER: %s (size mismatch: src=%s dst=%s)" % (file, src_list[file]['size'], dst_list[file]['size']))
attribs_match = False

if attribs_match and 'md5' in cfg.sync_checks:
if attribs_match and 'md5' in cfg.sync_checks and not cfg.no_check_md5:
## ... same size, check MD5
if src_and_dst_remote:
src_md5 = src_list[file]['md5']
Expand Down Expand Up @@ -1300,6 +1300,11 @@ def do_remote2local_work(item, seq, total):
s3 = S3(Config())
uri = S3Uri(item['object_uri_str'])
dst_file = item['local_filename']

# is this actually a directory? skip it.
if os.path.isdir(dst_file):
return

seq_label = "[%d of %d]" % (seq, total)
try:
dst_dir = os.path.dirname(dst_file)
Expand Down Expand Up @@ -3270,6 +3275,8 @@ def main():
help="Number of retry before failing GET or PUT.")
optparser.add_option("--retry-delay", dest="retry_delay", type="int", action="store", default=3,
help="Time delay to wait after failing GET or PUT.")
optparser.add_option("--no-check-md5", dest="no_check_md5", action="store_false",
help="Skip md5 integrity check when using sync.")

optparser.set_usage(optparser.usage + " COMMAND [parameters]")
optparser.set_description('S3cmd is a tool for managing objects in ' +
Expand Down