![]() I have also tried stdout=subprocess.PIPE, stderr=subprocess.PIPE in subprocess, I know it wont help but tried this one aswell.I have tired nohup cmd > mylog.log 2>&1 &.Nohup /usr/bin/spark-submit -class -master yarn -deploy-mode client -conf =true gdl-spark-spd-1.0.jar sandbox > logs/sparkdetailed_SPD_TestSparkStreamingSleep_20220318_ 2> logs/sparkdetailed_SPD_TestSparkStreamingSleep_20220318_ logs/sparkdetailed_SPD_TestSparkStreamingSleep_20220318_ 2> logs/sparkdetailed_SPD_TestSparkStreamingSleep_20220318_ ', 'logs/sparkdetailed_SPD_TestSparkStreamingSleep_20220318_111813.log', '2>&1', '&'] Using shellTrue enables all of the shells features. Notes: Since shellTrue, the above uses command, not commandlist. When below command is ran from shell it tis working fine and redirecting the logs, but when ran from python subprocess it is not creating those log files If you want it to work with subprocess, you must specify shellTrue like: subprocess.call(command, shellTrue) This will allow you to run command in background. ![]() I am running a command is background using nohup in subprocess python using below command, but I am not able to redirect the logs to a different file instead of nohup.out. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |