aws s3 CLI 命令提前退出批处理文件

For*_*ero 2 batch-file amazon-s3 amazon-web-services aws-cli

这是我的批处理文件:

aws s3 sync ./dummy_dist s3://www.mywebsite.com --delete --profile www.mywebsite.com_deploy --debug

echo ________________ here 1 __________________
Run Code Online (Sandbox Code Playgroud)

回声线永远不会运行!

这是 aws 命令的调试输出:

2018-12-23 10:51:52,518 - MainThread - awscli.clidriver - DEBUG - CLI version: aws-cli/1.16.81 Python/3.7.2rc1 Windows/10 botocore/1.12.71
2018-12-23 10:51:52,518 - MainThread - awscli.clidriver - DEBUG - Arguments entered to CLI: ['s3', 'sync', './dummy_dist', 's3://www.mywebsite.com', '--delete', '--profile', 'www.mywebsite.com_deploy', '--debug']
2018-12-23 10:51:52,521 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function add_scalar_parsers at 0x0000025A115B4488>
2018-12-23 10:51:52,521 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function register_uri_param_handler at 0x0000025A1107F8C8>
2018-12-23 10:51:52,526 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function inject_assume_role_provider_cache at 0x0000025A110DF9D8>
2018-12-23 10:51:52,529 - MainThread - botocore.credentials - DEBUG - Skipping environment variable credential check because profile name was explicitly set.
2018-12-23 10:51:52,530 - MainThread - botocore.hooks - DEBUG - Event session-initialized: calling handler <function attach_history_handler at 0x0000025A11325840>
2018-12-23 10:51:52,531 - MainThread - botocore.hooks - DEBUG - Event building-command-table.s3: calling handler <function add_waiters at 0x0000025A115B7950>
2018-12-23 10:51:52,536 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.s3.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,537 - MainThread - botocore.hooks - DEBUG - Event building-command-table.sync: calling handler <function register_sync_strategies at 0x0000025A115B09D8>
2018-12-23 10:51:52,539 - MainThread - botocore.hooks - DEBUG - Event building-command-table.sync: calling handler <function add_waiters at 0x0000025A115B7950>
2018-12-23 10:51:52,541 - MainThread - botocore.hooks - DEBUG - Event building-arg-table.sync: calling handler <bound method BaseSync.add_sync_argument of <awscli.customizations.s3.syncstrategy.sizeonly.SizeOnlySync object at 0x0000025A11630860>>
2018-12-23 10:51:52,541 - MainThread - botocore.hooks - DEBUG - Event building-arg-table.sync: calling handler <bound method BaseSync.add_sync_argument of <awscli.customizations.s3.syncstrategy.exacttimestamps.ExactTimestampsSync object at 0x0000025A11687240>>
2018-12-23 10:51:52,546 - MainThread - botocore.hooks - DEBUG - Event building-arg-table.sync: calling handler <bound method BaseSync.add_sync_argument of <awscli.customizations.s3.syncstrategy.delete.DeleteSync object at 0x0000025A11687160>>
2018-12-23 10:51:52,549 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.paths: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,551 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.dryrun: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,554 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,555 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.quiet: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,556 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,557 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,557 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.acl: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,558 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.follow-symlinks: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,559 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,562 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,566 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,566 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse-c: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,567 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse-c-key: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,568 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse-kms-key-id: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,568 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse-c-copy-source: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,569 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.sse-c-copy-source-key: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,570 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.storage-class: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,571 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.grants: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,577 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.website-redirect: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,578 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-type: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,579 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.cache-control: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,580 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-disposition: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,581 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-encoding: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,581 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.content-language: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,582 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.expires: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,587 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.source-region: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,588 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.only-show-errors: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,588 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,589 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.anonymous: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,590 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.page-size: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,591 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.ignore-glacier-warnings: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,591 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,592 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.force-glacier-transfer: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,598 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,598 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.request-payer: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,599 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.metadata: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,600 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.metadata-directive: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,601 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.size-only: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,602 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,602 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.exact-timestamps: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,604 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,608 - MainThread - botocore.hooks - DEBUG - Event load-cli-arg.custom.sync.delete: calling handler <awscli.paramfile.URIArgumentHandler object at 0x0000025A11687F98>
2018-12-23 10:51:52,608 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.custom.sync: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000025A110A4470>
2018-12-23 10:51:52,610 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: assume-role
2018-12-23 10:51:52,610 - MainThread - botocore.credentials - DEBUG - Looking for credentials via: shared-credentials-file
2018-12-23 10:51:52,612 - MainThread - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
2018-12-23 10:51:52,613 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Users\adamdry\AppData\Local\Programs\Python\Python37\lib\site-packages\botocore\data\endpoints.json
2018-12-23 10:51:52,618 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000025A10DB9B70>
2018-12-23 10:51:52,620 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Users\adamdry\AppData\Local\Programs\Python\Python37\lib\site-packages\botocore\data\s3\2006-03-01\service-2.json
2018-12-23 10:51:52,628 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x0000025A10D79BF8>
2018-12-23 10:51:52,628 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x0000025A10D799D8>
2018-12-23 10:51:52,630 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-23 10:51:52,634 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2018-12-23 10:51:52,637 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: s3
2018-12-23 10:51:52,639 - MainThread - botocore.client - DEBUG - Defaulting to S3 virtual host style addressing with path style addressing fallback.
2018-12-23 10:51:52,640 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000025A10DB9B70>
2018-12-23 10:51:52,641 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x0000025A10D79BF8>
2018-12-23 10:51:52,642 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x0000025A10D799D8>
2018-12-23 10:51:52,643 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-23 10:51:52,663 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2018-12-23 10:51:52,664 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: s3
2018-12-23 10:51:52,666 - MainThread - botocore.client - DEBUG - Defaulting to S3 virtual host style addressing with path style addressing fallback.
2018-12-23 10:51:52,667 - MainThread - botocore.hooks - DEBUG - Event choose-service-name: calling handler <function handle_service_name_alias at 0x0000025A10DB9B70>
2018-12-23 10:51:52,670 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x0000025A10D79BF8>
2018-12-23 10:51:52,671 - MainThread - botocore.hooks - DEBUG - Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x0000025A10D799D8>
2018-12-23 10:51:52,671 - MainThread - botocore.args - DEBUG - The s3 config key is not a dictionary type, ignoring its value of: None
2018-12-23 10:51:52,674 - MainThread - botocore.endpoint - DEBUG - Setting s3 timeout as (60, 60)
2018-12-23 10:51:52,680 - MainThread - botocore.client - DEBUG - Registering retry handlers for service: s3
2018-12-23 10:51:52,681 - MainThread - botocore.client - DEBUG - Defaulting to S3 virtual host style addressing with path style addressing fallback.
2018-12-23 10:51:52,683 - MainThread - awscli.customizations.s3.s3handler - DEBUG - Using a multipart threshold of 8388608 and a part size of 8388608
2018-12-23 10:51:52,684 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.sizeonly.SizeOnlySync object at 0x0000025A11630860>>
2018-12-23 10:51:52,685 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.exacttimestamps.ExactTimestampsSync object at 0x0000025A11687240>>
2018-12-23 10:51:52,686 - MainThread - botocore.hooks - DEBUG - Event choosing-s3-sync-strategy: calling handler <bound method BaseSync.use_sync_strategy of <awscli.customizations.s3.syncstrategy.delete.DeleteSync object at 0x0000025A11687160>>
2018-12-23 10:51:52,726 - MainThread - botocore.loaders - DEBUG - Loading JSON file: C:\Users\adamdry\AppData\Local\Programs\Python\Python37\lib\site-packages\botocore\data\s3\2006-03-01\paginators-1.json
2018-12-23 10:51:52,728 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.ListObjectsV2: calling handler <function set_list_objects_encoding_type_url at 0x0000025A10DE1840>
2018-12-23 10:51:52,729 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.ListObjectsV2: calling handler <function validate_bucket_name at 0x0000025A10DE2598>
2018-12-23 10:51:52,732 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.ListObjectsV2: calling handler <bound method S3RegionRedirector.redirect_from_cache of <botocore.utils.S3RegionRedirector object at 0x0000025A0FF47BE0>>
2018-12-23 10:51:52,733 - MainThread - botocore.hooks - DEBUG - Event before-parameter-build.s3.ListObjectsV2: calling handler <function generate_idempotent_uuid at 0x0000025A10DE21E0>
2018-12-23 10:51:52,734 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.ListObjectsV2: calling handler <function add_expect_header at 0x0000025A10DE2A60>
2018-12-23 10:51:52,735 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.ListObjectsV2: calling handler <bound method S3RegionRedirector.set_request_url of <botocore.utils.S3RegionRedirector object at 0x0000025A0FF47BE0>>
2018-12-23 10:51:52,735 - MainThread - botocore.hooks - DEBUG - Event before-call.s3.ListObjectsV2: calling handler <function inject_api_version_header_if_needed at 0x0000025A10DE1F28>
2018-12-23 10:51:52,736 - MainThread - botocore.endpoint - DEBUG - Making request for OperationModel(name=ListObjectsV2) with params: {'url_path': '/www.mywebsite.com?list-type=2', 'query_string': {'prefix': '', 'encoding-type': 'url'}, 'method': 'GET', 'headers': {'User-Agent': 'aws-cli/1.16.81 Python/3.7.2rc1 Windows/10 botocore/1.12.71'}, 'body': b'', 'url': 'https://s3.eu-west-1.amazonaws.com/www.mywebsite.com?list-type=2&prefix=&encoding-type=url', 'context': {'client_region': 'eu-west-1', 'client_config': <botocore.config.Config object at 0x0000025A0FF4B668>, 'has_streaming_input': False, 'auth_type': None, 'encoding_type_auto_set': True, 'signing': {'bucket': 'www.mywebsite.com'}}}
2018-12-23 10:51:52,737 - MainThread - botocore.hooks - DEBUG - Event request-created.s3.ListObjectsV2: calling handler <function signal_not_transferring at 0x0000025A111AB400>
2018-12-23 10:51:52,742 - MainThread - botocore.hooks - DEBUG - Event request-created.s3.ListObjectsV2: calling handler <bound method RequestSigner.handler of <botocore.signers.RequestSigner object at 0x0000025A0FF4B1D0>>
2018-12-23 10:51:52,744 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.ListObjectsV2: calling handler <bound method ClientCreator._default_s3_presign_to_sigv2 of <botocore.client.ClientCreator object at 0x0000025A1191DD68>>
2018-12-23 10:51:52,744 - MainThread - botocore.hooks - DEBUG - Event choose-signer.s3.ListObjectsV2: calling handler <function set_operation_specific_signer at 0x0000025A10DE20D0>
2018-12-23 10:51:52,745 - MainThread - botocore.hooks - DEBUG - Event before-sign.s3.ListObjectsV2: calling handler <function fix_s3_host at 0x0000025A10C79488>
2018-12-23 10:51:52,745 - MainThread - botocore.utils - DEBUG - Checking for DNS compatible bucket for: https://s3.eu-west-1.amazonaws.com/www.mywebsite.com?list-type=2&prefix=&encoding-type=url
2018-12-23 10:51:52,746 - MainThread - botocore.utils - DEBUG - Not changing URI, bucket is not DNS compatible: www.mywebsite.com
2018-12-23 10:51:52,747 - MainThread - botocore.auth - DEBUG - Calculating signature using v4 auth.
2018-12-23 10:51:52,752 - MainThread - bo

Joh*_*ley 7

把这个词call放在前面aws s3 sync ...

程序 aws 实际上是一个脚本。当此脚本退出时,它会终止环境,这意味着不会再运行其他命令。添加调用可以防止这种情况,以便批处理文件中的下一个命令将运行。