Python Subprocess returns non-zero exit status only in cron

You should try to capture stderr in addition to stdout so that you can find out exactly why the program is failing (assuming it does indeed print some errors for you)

cmd = [‘/path/to/casperjs’, ‘/path/to/doSomething.js’, ‘args’] response = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 0 ok 126 权限,拷贝一份,并赋予该用户所有的权限 […]