使用aws s3 sync同步显式包含的文件,并忽略其他所有内容

时间:2019-01-04 13:15:19

标签: amazon-web-services amazon-s3

我想使用aws来备份我的(Linux)主目录,但不包括所有文件(明确包含的文件除外)。所以,我正在使用:

aws s3 sync /home/me/ s3://bucket/ --region us-east-1 \
   --exclude "*" \
   --include "a/*" \
   --include "b/*"

直觉上,这应该备份目录/home/me/a//home/me/b,并忽略所有其他目录,例如/home/me/.Trash,但我得到以下错误消息:

[Errno 2] No such file or directory: '/home/me/.Trash/files/f.2'
Completed 1 part(s) with ... file(s) remaining

我怎么了?

1 个答案:

答案 0 :(得分:0)

似乎我正在运行旧版本的aws,并在Amazon's instructions之后升级,并且不再收到该错误。