2017-02-04 12 views
1

を働いていない除外私は、このCLIを使用しています:AWS S3のCLI:

aws s3 sync /home/me s3://meserver/test_me --exclude "*.o" --exclude "error_log" --exclude "access_log" --exclude "*.tgz" --exclude "*.tar.gz" --exclude "*.zip" --exclude "*.log" --exclude "*.tar" 

.zipファイルとソートがうまく除外する。しかし、error_logはそうではありません。

upload: ../../home/me/log/error_log to s3://meserver/testme/log/error_log 

何が欠けていますか?これは正確なファイル名です。

+2

はあなたがはい "*/error_logに" ' – franklinsijo

答えて

1

あなたのコマンドが言っている:それはerror_logと一致しないため、--exclude "error_log"

ただし、コピーされたオブジェクトは、log/error_logました。

このコマンドでは、ファイル名ではなくパスと接頭辞を使用しています。 Amazon S3に格納されているオブジェクトのkeyは実際には完全なパスと名前で構成されています。したがって、error_logを完全に参照する必要があります。

--exclude "log/error_log"を使用してファイルを除外できます。または、すべてのファイルを除外する場合は、--exclude "*/error_log"を使用します。

+0

--exclude'試すことができます。あなたのパターンの前に '* /'を追加するのが解決策です。私は 'aws s3 sync'は '* /'を必要としないrsyncのように動作するはずだと考えました。 Amazonのドキュメンテーションはこれを明確にするための例を示しています。 – nmgeek

0

試してみてください。

aws s3 sync /home/me s3://meserver/test_me --exclude "\*.o" --exclude "\*/error_log" --exclude "access_log" --exclude "\*.tgz" --exclude "\*.tar.gz" --exclude "\*.zip" --exclude "\*.log" --exclude "\*.tar"