[英]How to make `aws s3 sync` ignore size and only use last modified time
有没有办法使aws s3 sync
仅使用上次修改时间 ?
即,即使文件大小不同,也仅在源比目标更新时才复制
如果没有,是否有简单的解决方法来获得此行为?
谢谢
如果此同步操作是从本地文件夹到S3目标的,则可以结合使用git和S3 Sync CLI的“ include”和“ exclude”选项来完成此操作
例如,
#!/bin/bash
set -ex
FILES=()
for i in $( git status -s | sed 's/\s*[a-zA-Z?]\+ \(.*\)/\1/' ); do
FILES+=( "$i" )
done
#echo "${FILES[@]}"
CMDS=()
for i in "${FILES[@]}"; do
CMDS+=("--include=$i""*")
done
#echo "${CMDS[@]}"
echo "${CMDS[@]}" | xargs aws s3 sync . s3://dest.com [-otherflags]"*"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.