aws crontab无法使用子进程工作

2024-06-01 07:36:29 发布

您现在位置:Python中文网/ 问答频道 /正文

Crontab正在工作,但不执行aws cli命令。我使用python和子流程.Popen在

import subprocess
does not work...
proc = subprocess.Popen("aws rds describe-db-instances > /tmp/testoutput.txt", stdout=subprocess.PIPE, shell=True)

does work...
proc = subprocess.Popen("echo $(date) > /tmp/testoutput.txt", stdout=subprocess.PIPE, shell=True)

相同的用户和相同的权限对aws凭证也有相同的权限。 awsrds从命令行描述数据库实例的工作


Tags: txtawstrue权限stdoutprocshelltmp