I have two shell scripts. One is for creating some logs (abc.sh) in one directory and another script (xyz.sh) is for sending email and moving those logs into different directory. Both script I am calling as below.
cmd="abc.sh"
try:
subprocess.call(cmd,shell=True)
except OSError:
print "Failed to run this option."
print 'Enter your email-id:'
cmd = "xyz.sh"
try:
subprocess.call(cmd,shell=True)
except OSError:
print "Failed to run this option
My question is, if someone else running the same python code at the same time they will not get the email with their respective logs for what they have executed the script. Because when someone is entering the email id, 2nd script (xyz.sh) sends mail and delete the logs. So could you please let me know how can we get rid of this situation from python code.