I have a python script, which should execute a shell script. But it should sleep 30 seconds before executing. I want the script to sleep in the background and then execute it.
The Shell Command should be like this: If I type this command directly to the console, it works.
(sleep 30 && /root/bin/myscript.sh parameter1 parameter2) > /dev/null 2>&1
Now from python: (I have divided the commands)
subprocess.call(['/bin/sleep', '30', '&'])
subprocess.call(['/root/bin/myscript.sh', str(dom), str(limit), '&'])
(str(dom) and str(limit) are the 2 parameters)
I get this error:
/bin/sleep: invalid time interval `&'
Why does it take &
as parameter instead of 30?